My code is run correct but not submitted in codechef | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

My code is run correct but not submitted in codechef

Chef hasĀ XXĀ coins worthĀ 11Ā rupee each andĀ YYĀ coins worthĀ 22Ā rupees each. He wants to distribute all of theseĀ X+YX+YĀ coins to his two sons so that the total value of coins received by each of them is the same. Find out whether Chef will be able to do so. Input Format The first line of input contains a single integerĀ TT, denoting the number of testcases. The description ofĀ TTĀ test cases follows.Each test case consists of a single line of input containing two space-separated integersĀ XXĀ andĀ YY. Output Format For each test case, print "YES" (without quotes) if Chef can distribute all the coins equally and "NO" otherwise. You may print each character of the string in uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical). Constraints 1ā‰¤Tā‰¤1031ā‰¤Tā‰¤1030ā‰¤X,Yā‰¤1080ā‰¤X,Yā‰¤108X+Y>0X+Y>0 Subtasks Subtask 1 (100 points):Ā Original constraints Sample InputĀ 1Ā  4 2 2 1 3 4 0 1 10 Sample OutputĀ 1Ā  YES NO YES NO Explanation Test caseĀ 11:Ā Chef gives each of his

5th Nov 2021, 1:43 PM
Ankit Kumar
Ankit Kumar - avatar
8 Respostas
+ 2
Ankit Kumar I think what if the two numbers are 3 and 1? Your code prints "no" but 3+1 is 4 and can be distributed equally right? Here is your fixed code https://code.sololearn.com/cp9PMUzt5c5p/?ref=app
5th Nov 2021, 2:38 PM
Rishi
Rishi - avatar
+ 2
For your code, what is the expected output and your output? And use English plz, I don't know Hindi
6th Nov 2021, 2:27 AM
Rishi
Rishi - avatar
5th Nov 2021, 1:43 PM
Ankit Kumar
Ankit Kumar - avatar
+ 1
Codechef and hackerrank problems are created with time constraints of the logic is correct and giving correct output than try to reduce the timelimit of loops by making use of logic which will take less time to iterate.
5th Nov 2021, 3:14 PM
Preity
Preity - avatar
0
Nhi bhai 3 coins ko equaly distribute nhi kar sakte
5th Nov 2021, 2:55 PM
Ankit Kumar
Ankit Kumar - avatar
0
No of coins must be same
5th Nov 2021, 3:03 PM
Ankit Kumar
Ankit Kumar - avatar
0
Bhai 3*2+1=7
5th Nov 2021, 3:21 PM
Ankit Kumar
Ankit Kumar - avatar
0
Ho gayenge
5th Nov 2021, 3:21 PM
Ankit Kumar
Ankit Kumar - avatar