about summary refs log tree commit diff
path: root/others/easy20160714/10.c
blob: fefd6d36c7ded2eb758d10f9dab7e0e09da7d89a (plain) (blame)
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
#include <stdio.h>

int main()
{
	FILE *f = fopen("INP.TXT", "r");
	unsigned long long n;
	long long a, b, c;
	char s[5] = {89, 69, 83, 10};

	fscanf(f, "%lld", &n);

	if (n > 2) {
		fscanf(f, "%lld %lld", &a, &b);
		c = b - a;

		for (n -= 2; n; n--) {
			a = b;
			fscanf(f, "%lld", &b);

			if (a - b + c) {
				s[0] = 78;
				s[1] = 79;
				s[2] = 10;
				s[3] = 0;

				break;
			}
		}
	}

	fclose(f);

	f = fopen("OUT.TXT", "w");

	fputs(s, f);

	fclose(f);

	return 0;
}