My issue
I am writing the perfect code of the given question but when I submit the code then output is showing wrong
My code
// Update the code below to solve this problem
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int X, Y;
cin>>X>>Y;
if(X<Y){
cout<<(500-X*2)+(1000-(X+Y)*4)<<endl;
}
else{
cout<<(1000-Y*4)+(500-(X+Y)*2)<<endl;
}
}
return 0;
}
Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone