Cauchy - Schwarz was something taught in middle school so Im quite surprised to see not many people know it. This problem is ridiculously basic if you do.

We all have different backgrounds, including schools.

1 Like

This is the sort of solution I like, that does not depend on happening to know a mathematical trick! I also worked backwards from observing the pattern in the supplied test cases.

3 Likes

Yeah, that’s why I say I’m quite surprised to see that not many countries do the same.

This is what I was looking for.

Thank you!

2 Likes

@vijju123 thanks for the help, found the mistake. Since I did not simplify the formula completely, there was a long long overflow that occurred during multiplication of k’s, removed that from both numerator and denominator and now the solution is passing fully.

1 Like

it is olympiad maths

1 Like