CSES - Datatähti 2025 loppu - Results
Submission details
Task:Leikkijät
Sender:a256
Submission time:2025-01-18 16:54:36 +0200
Language:C++ (C++11)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:9:14: error: 't' was not declared in this scope; did you mean 'tm'?
    9 |         cin>>t;
      |              ^
      |              tm

Code

#include <bits/stdc++.h>
#define F first
#define S second
#define N 2000000
using namespace std;
int a,b;
int main(){
	cin.tie(0)->sync_with_stdio(0);
	cin>>t;
	for(int i=0;i<t;++i){
		cin>>a>>b;
		if(b%2){ // prl
			if(b==a+2) cout<<b<<'\n';
			else cout<<"-1\n";
		} else {
			if(b==1) cout<<a+1<<'\n';
			else if(b==3) cout<<a<<'\n';
			else cout<<"-1\n";
		}
	}
}