Winning CB scholarship

https://ide.codingblocks.com/s/41000
https://hack.codingblocks.com/contests/c/512/1226

The sample cases run fine, but doesn’t pass all test cases on submission
says run error in 3/6 test cases, because i/p can be 10^9, but I can only take array of 10^6 or 10^8 size

tried with vector too, gives runtime error https://ide.codingblocks.com/s/41005

@apoorvagupta96 there is no need to create any vector . Just do binary search on your answer variable because answer lies between 0 and N.

have done that in code
there is a boolean func named “possible”

Exactly , so no need of taking an extra array because you know the range of answer.
So just call binary search on this range using possible function of ur code , dat’s it .

https://ide.codingblocks.com/s/41035

have done the changes, but works for 1 sample test case, not for another, where am i going wrong now?

You initialised the s and e with wrong values
Go through this code , i have commented the bug in ur code
https://ide.codingblocks.com/s/41037

okay, thank you so much!