Skip to content

Commit 8d39af3

Browse files
authored
Merge pull request #142 from saloni-laddha/master
Added Chef and Serves problem codechef
2 parents e663753 + d9760d1 commit 8d39af3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CodeChef_problems/Chef and Serves.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
int main(){
4+
int t;
5+
cin>>t;// number of test cases
6+
while(t--)
7+
{
8+
int s,p1,p2,k;
9+
cin>>p1>>p2>>k;
10+
s=int((p1+p2)/k); //no. of times serves will change
11+
if(s%2==0) //check if that number is even or odd
12+
cout<<"CHEF"<<endl;
13+
else
14+
cout<<"COOK"<<endl;
15+
}
16+
17+
}
18+

0 commit comments

Comments
 (0)