#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include "game.h"
#define ll long long
using namespace std;
ll kord[2001][2001];
vector<pair<int, int>> g;
ll gcd(ll x,ll y) {
	if (x > y) {
		swap(x, y);
	}
	if (x == 0) {
		return y;
	}
	if (y % x == 0) {
		return x;
	}
	return gcd(y%x,x);
}
void init(int R, int C) {
	
}
void update(int P, int Q, long long K) {
	kord[P][Q] = K;
	g.push_back({ P,Q });
}
long long calculate(int P, int Q, int U, int V) {
	ll answ = 0;
	ll x = log2(V - Q + 1);
	for (auto i : g) {
		if (i.first >= P && i.first <= U && i.second >= Q && i.second <= V) {
			answ = gcd(answ, kord[i.first][i.second]);
		}
	}
	return answ;
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |