I have tried the code on codechef ide and it gave the desired output but on being submitted here it gave wrong output. I have provided the code and all necessary details below. Please check if you can help with this. Thank you in advance.
Contest:Codeforces Round 381 (Div. 2) Problem:740B - Alyona and flowers Submission:114845312