Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define ll long long
- #define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
- using namespace std;
- int main(){
- fastio;
- ll t;
- cin >> t;
- ll ans[1000];
- while (t--){
- ll s , n , k;
- ll in = 0;
- cin >> s >> n >> k;
- memset (ans , -1 , sizeof ans);
- for (ll i = n ; i > 0 && in != s+ 1 ; i--){
- for (ll j = 0; j < k && in != s + 1 ; j++){
- ans[in++] = 0;
- for (int kk = 0 ; kk < i && in != s + 1 ; kk++){
- ans[in++] = 1;
- }
- }
- }
- if (ans[s-1] == 1)
- cout << "first player";
- else
- cout << "second player";
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement