Comments

Here you are moving too many numbers. You are only allowed to move only one number and place it either on prefix or suffix so that sum of prefix and suffix are equal

How B can be solved in O(n). Can anyone give me some hints

for example, if the test case is

3
2 3 3
3
3 3 1

then without a sorting answer will be 2.bcz (2,3),(3,3) makes pair and (3,1) isn't a pair. but after sorting, it looks like

2 3 3
1 3 3

so, the answer is 3. That's why sorting is needed here

oh I get it, Thanks for replying

"you can change your handle (but only once)" Does this mean I can change once in this year? or is this for the whole upcoming time?

x+2x+4x+⋯+2^(k−1) x = n. Here if u take x as common then 1+2+4+⋯+2(k−1) = n; for left side 1+2+4+⋯+2(k−1) = 2^k — 1; so from here you can easily find x by iterating over k

Thanks for the explanation. Understood it. :)

Can anyone help me to understand Problem C statement in a simple way? Thanks in Advance :)

Your explanation is great. It very much clears everything. Thank you very much from the bottom of the heart.

I understood why you used this formula, but Sorry, I can't understand how you used this formula when only 'k' and 'n' are given.

I am still having a problem understanding. What I understood for first 'b' is that it will be 1 time in 1st position, 2 times in second position and so on, but how do I find out that what will be the answer when I have only the info of 'k'.

Though thanks for the observation.

sorry sorry, my mistake again, 2333333333333/3 googled it, and it showed that divisible. But after checking manually, I can understand it is not divisible.

Sorry, typing mistake. It was "divisible by 3". Just edited it now.

For 1326A — Bad Ugly Numbers, as the solution of the editorial if n = 13 then the output comes 2333333333333. But it is divisible by 3, which doesn't fit those conditions. Then isn't the solution wrong?