Problem Link: https://mirror.codeforces.com/contest/514/problem/A Submission1 : https://mirror.codeforces.com/contest/514/submission/206932949 which gives me RTE but in next submission the same code is AC. accepted submission: https://mirror.codeforces.com/contest/514/submission/206933863