Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
int a, b, c;
cin>>a>>b>>c;
int diff = 2 * b - (a + c);
(diff % 3 == 0) ? cout<<0<<endl : cout<<1<<endl;
}
}
Copy The Code &
Try With Live Editor
Input
3
3 4 5
2 2 6
1 6 5
3 4 5
2 2 6
1 6 5
Output
0
1
0
1
0
Demonstration
Coodeforcess Solution 1605-A A. A.M. Deviation ,C++, Java, Js and Python ,1605-A,Coodeforcess Solution