I am trying to implement the logic that Rachit Jain’s explains in this video
But i am only passing one test case. Please help me with this code
problem link
Update both ans and ans_z only when temp_ans > ans
. When temp_ans == ans, update ans_z only when z1/z2 is less than ans_z. This way you will find the minimum z which gives maximum of f(x, y, z).
https://www.codechef.com/viewsolution/33026290 My code is mostly based on the editorial but the idea is same.