correct me please

I am new to the programming world and tried my first problem on CodeChef -

My solution is shown wrong -
https://www.codechef.com/viewsolution/55200598

Why have you declared T = 3 ?
T is the number of test cases, which is given to you as an input alongwith a and b.
Your code should be like this -

int main(){
     int t; cin>>t;
     for(int i=0; i<t; i++){
          int a, b; cin>>a>>b; ////

         ///
}

Your suggestion worked.
Thanks a lot.

1 Like