ok so getting intuition was only main thing in the contest that’s why I don’t like such adhoc problemsets.
anyways Nice intuition keep it up bro.
To make up the maximum element(max) we need to do at least max operations on a single element which will cause a net increase of max * k in the array.
On that lines I built the solution.
But I can’t prove that : For every larger value of sum greater than max * k and divisible by k
the solution will surely exist.
I submitted without proving
I can say some random proofs, but I’m not sure and i don’t want to misguide someone. Let’s wait for the editorial, shall we?
Thanks My mind was chocked to think that later condition that answer will exist always if max<=(sum/k) great minded persons submitted this question.
No harm in giving a try.
Please explain why do you think so??
Does this contest have a editorial?
Editorials will be posted soon.
You are getting run-time error because you are taking input b and c in int data type but they are real values as mentioned in input format.
I also didn’t notice that the input b and c could be doubles until the very end. There should atleast be a sample input for such case. Or the existing sample simply could’ve had decimal and trailing zeroes.
Its like the setter intentionally wanted to make it not obvious.
We are extremely sorry for the issue you faced. Problem Setters didn’t had any such intention. We did not realised, until you mentioned, about this kind of misunderstanding. We’ll make sure not to repeat this thing in our future contests.
Run the code from this link.
Input:
1.0000000 1.0000000
Give the following as input and I think that will clear you why you were getting RTE on assertion.
And again I’m sorry if you missed that input will be real numbers. We’ll make sure this won’t happen again.
When will the editorial for “Is this long challenge” be out?
Thanks.