aboutsummaryrefslogtreecommitdiff
path: root/2020/day2/reopen.cpp
blob: 0d64e84207db243cb0f15a6e8aefee819503adcd (plain)
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
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0);

	int n, a, b;
	string r;
	cin >> n >> a >> b >> r;
	
	if (r == "1/2") {
		for (int i = 0; i < n / 2; ++i) cout << b * i << ' ' << 0 << '\n';
		for (int i = n / 2; i < n; ++i) cout << b * i + a << ' ' << 0 << '\n';
	}
	else {
		int d = a * (b + 1) / 2 % b;
		for (int i = 0; i < n; ++i) {
			int x = d + (i / 4) * b, y = 0;
			if (i % 2 == 1) swap(x, y);
			if (i % 4 == 2) x = -x;
			if (i % 4 == 3) y = -y;
			cout << x + 500000000 << ' ' << y + 500000000 << '\n';
		}
	}
}