Editorial for JDCC '15 Contest 2 P1 - Lifting Weights
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
The amount of weight that Lily can lift grows linearly. This means that we can develop a linear equation of how much she is able to lift in the form of:
Where is how much more she can lift every week, and is how much she can lift at the start.
The only trick to this problem is to note that we don't add to the amount she can lift times, as Lily's doesn't get stronger until the second week. So, we have .
The final output for each test case is .
Time Complexity:
Comments