My issue
give code
My code
// Update the code below to solve the problem
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int N, M;
cin>>N>>M;
int pairNeeded = 2*N;
int extra = max(0, pairNeeded-M);
cout<<extra<<endl;
}
return 0;
}
Learning course: Beginner DSA in C++
Problem Link: CodeChef: Practical coding for everyone