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.
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.
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.
@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.
it is olympiad maths