Hi Andrew, The equation estimates n < (X/C)-(a/F). Hence, it should be fine to round to the lower integer irrespective of the decimal. Even in this case, 1.99999999999997 should be round to 1 and not to 2, if the equation is work. Further, we cannot buy fractional farms, so n cannot be a floating point number...!
On Thursday, April 17, 2014 2:45:25 AM UTC-4, M.H. wrote: > Hi Sivasathivel, > > > > In the code 'n' is declared as an integer. Hence, it would be round to the > > nearest lower value. > > For example, if the equation > provides something as 2.6, it would be round > > to 'n' = 2. > > > I always feel unsure about implicit rounding of this kind. What if your > equation evaluates to 1.99999999999997? Up to rather tiny epsilon it would > equal to 2, but your way would result in 1. > > > > Though it may be a part of my religious fear of float arithmetics. :) > > > Regards, > > Andrew > > > > 2014-04-17 3:56 GMT+04:00 Aaron Chan <[email protected]>: > > > > On Wednesday, April 16, 2014 5:56:48 PM UTC-4, Sivasathivel Kandasamy wrote: > > > Alara, > > > > > > > > > > > > Thank you very much for helping me. I used XCode in Mac and I could > > understand these little differences. However, these are so small, smaller > > than the tolerance they have mentioned. > > > > > > > > > > > > Now, I at loss, whom to ask on why my outputs were rejected... > > > > > > > > > > > > In any case, thanks a lot... > > > > > > > > > > > > P.S.: hmm, google seems to be cheating its participants...! :) > > > > > > > > > > > > > > > > > > On Wednesday, April 16, 2014 1:03:31 PM UTC-4, alara wrote: > > > > > > > I'm agree with Emil, > > > > > > > I compared your code with mine and gave the same result and was accepted > > > in the practice mode on the CodeJam page. > > > > > > > > > > > > > > > > > > > > > The "strange" thing that I saw is that actually there are some little > > > differences in our results. I used the "B-large-practice.in" and did the > > > difference betwen your code and mine and printed those which are > > > different to zero, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Case #6: -0.0000000000000157 > > > > > > > Case #18: 0.0000000000000002 > > > > > > > Case #30: -0.0000000000000215 > > > > > > > Case #31: 0.0000000000036380 > > > > > > > Case #32: -0.0000000000036380 > > > > > > > Case #40: 0.0000000000000219 > > > > > > > > > > > > > > > > > > > > > Case #51: 0.0000000000036380 > > > > > > > Case #57: 0.0000000000036380 > > > > > > > Case #60: -0.0000000000036380 > > > > > > > Case #62: 0.0000000000036380 > > > > > > > Case #63: 0.0000000000000058 > > > > > > > Case #65: 0.0000000000036380 > > > > > > > > > > > > > > > > > > > > > Case #70: 0.0000000000036380 > > > > > > > Case #74: 0.0000000000036380 > > > > > > > Case #97: 0.0000000000036380 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > So, I thnig that the detail could be on you compiler or your SO , I use > > > Dev-C++ 4.9.9.2 and W7 on 64bits > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > regards, > > > > > > > alara > > > > > > > > > > > > > > > > > > > > > > > > > > > > 2014-04-16 11:31 GMT-05:00 Emil Maskovsky <[email protected]>: > > > > > > > > > > > > > > > > > > > > > I tried to build and run your code on my inputs and your program is > > > giving me correct results (or at least the same as my accepted results) > > > for both small and large. The direct conversion from float to int should > > > be the same as floor() in the principle (for non-negative results, and > > > the negative results are ignored anyway) ... although the ceil(...)-1 > > > should be more correct, as I mentioned before (floor will give you n+1 in > > > the cases, where both n and n+1 will supply the same result), but the n > > > is actually not required and the time should be the same, so it should > > > not matter. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Which compiler (and version) did you use to compile the program, and > > > under which operating system? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Tuesday, April 15, 2014 11:54:54 PM UTC+2, Sivasathivel Kandasamy > > > wrote: > > > > > > > > > > > > > > > Hi guys, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks for the response... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Here is the code: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #include <iostream> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #include <fstream> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #include <ctime> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #include <time.h> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #include <iomanip> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > #define CPS 2 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > using namespace std; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > int main(int argc, const char * argv[]) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > { > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ifstream infile("input2.in"); //I renamed the google input file for > > > > simplicity > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ofstream outfile("output.out"); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > int nCases; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > infile >> nCases; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > cout<<"# Cases: "<<nCases<<endl; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > for (int ci = 0; ci < nCases; ci++) { > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > double C, F, X; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > infile >> C; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > infile >> F; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > infile >> X; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > int n = (X/C) - (CPS/F); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > if (n < 0) { > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > n = 0; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > double tn = 0;//Time Taken to by nFarms > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > for (int i=1; i <=n; i++) { > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > tn += C/(CPS+((i-1)*F)); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > double tw = tn + X/(CPS+n*F); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > cout<<"Case #"<<std::fixed<< std::setprecision(7)<<ci+1<<": > > > > "<<tw<<endl; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > outfile<<"Case #"<<ci+1<<": "<<std::fixed<< > > > > std::setprecision(7)<<tw<<endl; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > infile.close(); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > outfile.close(); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > return 0; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Could any one spot any problem? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks in Advance, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Monday, April 14, 2014 1:36:23 PM UTC-4, Jugesh Sundram wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi Siva, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Can you post your code so that we can have a closer inspection? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Apr 14, 2014 1:24 PM, "Sivasathivel Kandasamy" > > > > > <[email protected]> wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I attempted the second problem, which took all the time irrespective > > > > > of my confidence in my logic. I mean I tested my algorithm with the > > > > > samples given in the problem page and was able to get answers correct > > > > > to the last decimal. However, when I used their input and produced > > > > > the output, Google Code Jam didn't accept my outputs. I'm totally at > > > > > loss where the problem was... And I posted the problem in Stack > > > > > Exchange, where many seems to agree with my logic. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Losing the qualification round is painful, but I would be worth it if > > > > > I could know where I went wrong... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Here is the logic I came with... (with some algebra...): > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Let us assume, n as the minimum number of Farms to buy to win in the > > > > > shortest time. n is a non-negative integer value. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > a is the number of cookies one gets per second, a=2; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > n is the minimum number of farms to buy to win, if and only if the > > > > > following equation is satisfied... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > i.e time taken to buy n−1 farms + time to reach goal with (n−1) Farms > > > > > > time taken to buy n farms + time to reach goal with n Farms > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > However, time taken to buy n Farms =∑C/(a+(i−1)F); i = 1,...,n > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Therefore LHS becomes: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (∑C/(a+(i−1)F))+(X/(a+(n−1)F)) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > RHS becomes > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (∑C/(a+(i−1)F))+(X/(a+nF))+C/(a+(n−1)F) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > by rearranging the equations, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (X/(a+(n−1)F))>(X/(a+nF))+(C/(a+(n−1)F))(eq.1) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (X/(a+(n−1)F))−(X/(a+nF))>(C/(a+(n−1)F)) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > After some rearrangements, it becomes: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > XF/(a+nF)>C > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > XF>C(a+nF) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > XF/C>a+nF > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (XF/C)−a>nF > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (1/F)((XF/C)−a)>n > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (X/C)−(a/F)>n > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > or > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > n <(X/C)−(a/F) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- by ensuring that n is an non-negative integer, this equation > > > > > would give the minimum number of farms,n, to buy. Assuming it is not > > > > > possible to buy fraction of farms > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > With n Farms, the total time taken to reach the goal would be given > > > > > by RHS of (eq.1) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Could anyone tell me, where I went wrong? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > As I sample, I tried with the samples and produced results correct to > > > > > the last decimal...! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > You received this message because you are subscribed to the Google > > > > > Groups "Google Code Jam" group. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > To unsubscribe from this group and stop receiving emails from it, > > > > > send an email to [email protected]. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > To post to this group, send email to [email protected]. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > To view this discussion on the web visit > > > > > https://groups.google.com/d/msgid/google-code/5d9cb132-96d9-43df-9a82-3705895148d4%40googlegroups.com. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > For more options, visit https://groups.google.com/d/optout. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Monday, April 14, 2014 1:36:23 PM UTC-4, Jugesh Sundram wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi Siva, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Can you post your code so that we can have a closer inspection? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Apr 14, 2014 1:24 PM, "Sivasathivel Kandasamy" > > > > > <[email protected]> wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I attempted the second problem, which took all the time irrespective > > > > > of my confidence in my logic. I mean I tested my algorithm with the > > > > > samples given in the problem page and was able to get answers correct > > > > > to the last decimal. However, when I used their input and produced > > > > > the output, Google Code Jam didn't accept my outputs. I'm totally at > > > > > loss where the problem was... And I posted the problem in Stack > > > > > Exchange, where many seems to agree with my logic. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Losing the qualification round is painful, but I would be worth it if > > > > > I could know where I went wrong... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Here is the logic I came with... (with some algebra...): > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Let us assume, n as the minimum number of Farms to buy to win in the > > > > > shortest time. n is a non-negative integer value. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > a is the number of cookies one gets per second, a=2; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > n is the minimum number of farms to buy to win, if and only if the > > > > > following equation is satisfied... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > i.e time taken to buy n−1 farms + time to reach goal with (n−1) Farms > > > > > > time taken to buy n farms + time to reach goal with n Farms > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > However, time taken to buy n Farms =∑C/(a+(i−1)F); i = 1,...,n > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Therefore LHS becomes: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (∑C/(a+(i−1)F))+(X/(a+(n−1)F)) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > RHS becomes > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (∑C/(a+(i−1)F))+(X/(a+nF))+C/(a+(n−1)F) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > by rearranging the equations, > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (X/(a+(n−1)F))>(X/(a+nF))+(C/(a+(n−1)F))(eq.1) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (X/(a+(n−1)F))−(X/(a+nF))>(C/(a+(n−1)F)) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > After some rearrangements, it becomes: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > XF/(a+nF)>C > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > XF>C(a+nF) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > XF/C>a+nF > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (XF/C)−a>nF > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (1/F)((XF/C)−a)>n > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > (X/C)−(a/F)>n > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > or > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > &... -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/6eeef906-c18a-45db-9564-75dae238127a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
