Untitled
unknown
c_cpp
3 years ago
734 B
9
Indexable
#include<bits/stdc++.h>
using namespace std ;
int main()
{
int t ;
cin >> t ;
for(int i =1 ;i<=t ;i++)
{
int a , b , c ,k ;
cin >> a >> b >>c >> k ;
bool f = true ;
if((a+b+c)%3!=0) f= false ;
else
{
long long sum = (a+b+c)/3 ;
// cout << sum << endl ;
int d = abs(sum-a) ;
int d2 = abs(sum-b) ;
int d3 = abs(sum-c) ;
// cout << d << " " << d2 << " " << d3 << endl ;
if(d%k!=0 || d2%k!=0 || d3%k!=0) f= false ;
}
if(f) cout << "Case " << i << ": " << "Peaceful" << endl ;
else cout << "Case " << i << ": " << "Fight" << endl ;
}
}Editor is loading...