1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//ANMHLIJKTJIY!
#pragma GCC optimize(2)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#include <bits/stdc++.h>
#include "dzilib.h"
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 998244353
#define F first
#define S second
#define ll long long
#define N 1001000
using namespace std;
ll d[N];
int main(){
	ll i,j;
	for(i=1;i<N;i++)
	{
		for(j=i;j<N;j+=i)
		{
			d[j]++;
		}
	}
	ll T=GetT(),lim=GetQ(),c=GetC(),n=GetN();
	while(T--)
	{
		vector<ll> v(20);
		for(i=0;i<20;i++)
		{
			v[i]=Ask(i);
		}
		for(i=1;i<=n;i++)
		{
			for(j=0;j<20;j++)
			{
				if(v[j]!=d[i+j])
				{
					break;
				}
			}
			if(j==20)
			{
				break;
			}
		}
		Answer(i);
	}
	return 0;
}