My issue
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;
int p1=500,p2=1000;
if(X<Y)
{
p1= p1 - 2*X;
p2 = p2 - 4*X - 4*Y;
}
else
{
p2 = p2 - 4*Y;
p1 = p1 - 2*Y - 2*X;
}
cout << p1+p2<<endl;
}
return 0;
}
Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone