1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
// PA 2024 5B Dzielniki
#include "dzilib.h"

int main() {
	long long a, beforeSquare1, beforeSquare2;
	int t = GetT();
	int q = GetQ();
	long long c = GetC();
	long long n = GetN();
	
	while(t--) {
		a = -1;
		while (Ask(++a) % 2 == 0) { }
		beforeSquare1 = a;
		while (Ask(++a) % 2 == 0) { }
		beforeSquare2 = a;
		Answer(((beforeSquare2 - beforeSquare1) / 2) * ((beforeSquare2 - beforeSquare1) / 2) - beforeSquare1);
	}
	return 0;
}