My issue
My code
// Update the code below to solve this problem
#include <iostream>
#include <string>
#include<cmath>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int X, Y;
cin>>X>>Y;
int sum = X + Y;
int problemA = 500, problemB = 1000;
int ansA = 500 - X * 2;
int ansB = 1000 - sum * 4;
int finalAns = ansA + ansB;
//If Chef attempts in the order B → A then he submits Problem B > A
int ansA1 = 1000 - X * 4;
int ansB1 = 500 - sum * 2;
int finalAns1 = ansA1 + ansB1;
cout << ceil(finalAns) << endl;
}
return 0;
}
Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone