blob: a57b5484632b6fbaad9ebebbcd9995f887360e5b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include <stdio.h>
int globina (int * a, int * b) {
int globina[2];
if (*a)
globina[0] = globina(a+*a, b);
if (*b)
globina[1] = globina(a, b+*b);
}
int main (void) {
int n;
scanf("%d\n", &n);
int a[n];
int b[n];
for (int i = 0; i < n; i++)
scanf("%d %d\n", &a[i], &b[i]);
printf("%d\n", globina(a, b));
}
|