This commit is contained in:
Matthieu Bessat 2021-12-05 16:52:20 +01:00
commit 82f8e11ae4
42 changed files with 5836 additions and 0 deletions

14
day_1/code.py Normal file
View file

@ -0,0 +1,14 @@
import fileinput
previous = None
count = 0
for i,line in enumerate(fileinput.input()):
try:
val = int(line.strip())
except ValueError:
continue
if previous != None and val > previous:
count += 1
previous = val
print(count)

18
day_1/code2.py Normal file
View file

@ -0,0 +1,18 @@
import fileinput
data = []
for inp in fileinput.input():
val = inp.strip()
if val != '':
int_value = int(val)
data.append(int_value)
prec = None
count = 0
for i in range(len(data) - 2):
s = data[i]+data[i+1]+data[i+2]
if prec != None and s > prec:
count += 1
prec = s
print(count)

11
day_1/input1.txt Normal file
View file

@ -0,0 +1,11 @@
199
200
208
210
200
207
240
269
260
263

2000
day_1/input2.txt Normal file

File diff suppressed because it is too large Load diff

23
day_2/code.py Normal file
View file

@ -0,0 +1,23 @@
import fileinput
data = []
for inp in fileinput.input():
val = inp.strip()
if val != '':
cmd, v = val.split()
data.append((cmd, int(v)))
horizontal = 0
aim = 0
depth = 0
for cmd, val in data:
if cmd == 'forward':
horizontal+=val
depth+=aim*val
if cmd == 'down':
aim+=val
if cmd == 'up':
aim-=val
print(horizontal, depth)
print(horizontal* depth)

6
day_2/input1.txt Normal file
View file

@ -0,0 +1,6 @@
forward 5
down 5
forward 8
up 3
down 8
forward 2

1001
day_2/input2.txt Normal file

File diff suppressed because it is too large Load diff

89
day_3/code.py Normal file
View file

@ -0,0 +1,89 @@
import fileinput
data = []
for inp in fileinput.input():
val = inp.strip()
if val != '':
data.append(val)
commons = []
epsilon = []
gamma = []
charLen = len(data[0])
lineLen = len(data)
for i in range(charLen):
count = 0
for j in range(lineLen):
if data[j][i] == '1':
count += 1
status = 'lt'
#print(count, lineLen-count)
if count == (lineLen-count): status = 'eq'
if count > (lineLen-count): status = 'gt'
if status == 'gt':
most,least = '1', '0'
else:
most,least = '0', '1'
gamma.append(most)
epsilon.append(least)
commons.append((status, most, least))
g = int(''.join(gamma), 2)
e = int(''.join(epsilon), 2)
def get_distribution(nbs):
out = []
for _i in range(len(nbs[0])):
count = 0
for _j in range(len(nbs)):
if nbs[_j][_i] == '1': count += 1
status = 'lt'
if count == (len(nbs)-count): status = 'eq'
if count > (len(nbs)-count): status = 'gt'
most,least = ('1', '0') if status == 'gt' else ('0', '1')
out.append((status, most, least))
return out
def filter_item(mode, status, most, least, x, i, full):
print(f'{mode=}, {status=}, {most=}, {least=}, {x=}, {i=}, {full=}')
if mode:
if status == 'eq':
return x == '1' # oxygen
if x == most: return True
if not mode: # co2
if status == 'eq':
return x == '0'
if x == least: return True
return False
def rating(inp, mode = True):
nb = inp.copy()
i = 0
while len(nb) > 1:
distri = get_distribution(nb)
print(f'= {len(nb)} -> {nb} {distri=}')
status, most, least = distri[i]
nb = list(filter(lambda x: filter_item(mode, status, most, least, x[i], i, x), nb))
i += 1
print(f'after filter: {nb}')
return int(nb[0], 2)
print(g, e)
print(g*e)
print(commons)
o = rating(data, True)
c = rating(data, False)
print('==')
print(o) # oxygen
print(c) # CO2
print(o*c)

12
day_3/input1.txt Normal file
View file

@ -0,0 +1,12 @@
00100
11110
10110
10111
10101
01111
00111
11100
10000
11001
00010
01010

1000
day_3/input2.txt Normal file

File diff suppressed because it is too large Load diff

BIN
day_3/main Normal file

Binary file not shown.

66
day_3/main.c Normal file
View file

@ -0,0 +1,66 @@
#include <string.h>
#include <stdio.h>
int tobin(char *inp)
{
int len = strlen(inp);
printf("%d", len);
int out = 0;
int i = 0;
while (inp[i] != '\0') {
if (inp[i] == '1') {
out = out | (1 << len-i-1);
}
i++;
}
return out;
}
int main(int argc, char** argv) {
char input;
char lines[1024][32];
int lineCount = 0;
int charCount = 0;
while (scanf("%c", &input) == 1) {
if (input == '\n') {
charCount = 0;
lineCount++;
} else {
lines[lineCount][charCount] = input;
charCount++;
}
}
charCount = strlen(lines[0]);
char gamma[32];
char epsilon[32];
printf("Recorded %d %d \n", lineCount, charCount);
for (int i = 0; i < charCount; i++) {
int oneCount = 0;
for (int j = 0; j < lineCount; j++) {
printf("%c", lines[j][i]);
if (lines[j][i] == '1')
oneCount++;
}
printf("\n count: %d \n", oneCount);
if (oneCount > (lineCount-oneCount)) {
epsilon[i] = '0';
gamma[i] = '1';
} else {
epsilon[i] = '1';
gamma[i] = '0';
}
printf("\n");
}
gamma[i+1] = '\0';
epsilon[i+1] = '\0';
printf("gamma: %s epsilon: %s \n", gamma, epsilon);
int e = tobin(epsilon);
int g = tobin(gamma);
printf("%d, %d \n", g, e);
printf("ans: %d \n", e*g);
}

8
day_3/tobin.py Normal file
View file

@ -0,0 +1,8 @@
inp = '01011'
out = 0
for i in range(0, len(inp)):
print(i, len(inp)-i-1)
if inp[i] == '1':
out = out | (1 << (len(inp)-i-1))
print(out)

87
day_4/code.py Normal file
View file

@ -0,0 +1,87 @@
import fileinput
import pprint
data = []
for inp in fileinput.input():
val = inp.strip()
if val == '':
data.append(None)
if val != '':
data.append(val)
# parse called numbers
to_be_called = list(map(int, data[0].strip().split(',')))
# parse boards
boards = []
currentBoard = []
for line in data[2:]:
if line == None:
boards.append(currentBoard)
currentBoard = []
continue
line_tmp = filter(lambda x: x != '', line.split(' '))
line_tmp = map(int, line_tmp)
currentBoard.append(list(line_tmp))
def is_row_valid(row, called):
to_cmp = list(map(lambda x: x in called, row))
return to_cmp == len(row)*[True]
def board_do_win(deb, board, calling):
for row in board:
if is_row_valid(row, calling):
return True
# generate columns
columns = []
for column_index in range(len(board[0])):
current_c = []
for row_index in range(len(board)):
current_c.append(board[row_index][column_index])
columns.append(current_c)
# if deb:
# print(f'{columns=}')
for column in columns:
if is_row_valid(column, calling):
return True
return False
def get_wins():
wins = []
index_to_wins = []
for i in range(len(to_be_called)):
calling = to_be_called[0:(i+1)]
for board_index,board in enumerate(boards):
if board_index in index_to_wins:
continue
deb = False
if calling == [7, 4, 9, 5, 11, 17, 23, 2, 0, 14, 21, 24, 10, 16, 13]:
print('DEBUG==')
deb = True
res = board_do_win(deb, board, calling)
if deb:
print(res, board)
if res:
wins.append((board_index, calling.copy(), board))
index_to_wins.append(board_index)
return wins, index_to_wins
def get_score_from_board(board, calling):
sum_unmarked = 0
for row in board:
for e in row:
if e not in calling:
sum_unmarked += e
return sum_unmarked * calling[-1]
score = 0
wins, index_to_wins = get_wins()
pprint.pprint(wins)
print(f'{index_to_wins=}')
i, calling, winner = wins[-1]
score = get_score_from_board(winner, calling)
pprint.pprint(winner)
print(f'{score=}')

20
day_4/input1.txt Normal file
View file

@ -0,0 +1,20 @@
7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 5
19 8 7 25 23
20 11 10 24 4
14 21 16 12 6
14 21 17 24 4
10 16 15 9 19
18 8 23 26 20
22 11 13 6 5
2 0 12 3 7

601
day_4/input2.txt Normal file
View file

@ -0,0 +1,601 @@
42,32,13,22,91,2,88,85,53,87,37,33,76,98,89,19,69,9,62,21,38,49,54,81,0,26,79,36,57,18,4,40,31,80,24,64,77,97,70,6,73,23,20,47,45,51,74,25,95,96,58,92,94,11,39,63,65,99,48,83,29,34,44,75,55,17,14,56,8,82,59,52,46,90,5,41,60,67,16,1,15,61,71,66,72,30,28,3,43,27,78,10,86,7,50,35,84,12,93,68
90 8 2 34 41
11 67 74 71 62
47 42 44 1 17
21 55 12 91 6
60 69 75 92 56
49 29 60 45 31
94 51 73 33 67
21 92 53 95 96
2 55 52 8 87
4 36 76 83 42
23 66 50 84 58
62 98 81 76 57
24 2 56 79 6
55 0 16 64 38
12 67 5 97 60
46 64 5 39 62
16 82 13 77 52
18 26 44 0 61
25 7 43 42 50
11 85 30 28 76
51 28 70 65 78
62 88 30 36 96
80 87 4 1 24
63 22 41 79 34
18 15 47 26 67
48 68 92 67 36
54 50 71 98 21
20 91 70 78 76
87 97 44 3 93
84 12 39 96 57
86 12 38 44 1
10 87 74 53 66
14 99 85 48 88
59 33 76 71 31
83 39 2 67 35
62 67 27 96 8
81 23 78 33 48
80 16 0 86 85
26 54 29 32 89
88 77 43 18 46
87 88 13 49 80
78 19 81 56 11
18 55 70 44 48
31 37 24 95 28
20 79 89 94 14
10 31 52 49 79
8 72 61 27 42
73 4 11 43 91
37 44 58 19 97
96 63 90 13 74
71 27 87 40 99
69 29 79 64 67
85 66 4 28 30
23 51 16 49 45
92 12 74 1 75
46 52 40 12 44
0 73 20 86 1
85 32 4 42 2
21 33 56 39 9
49 69 76 98 22
42 81 5 11 2
57 50 77 8 24
85 92 15 39 52
37 70 36 79 67
34 20 16 93 22
49 68 25 4 46
17 57 77 59 54
65 83 18 84 63
36 74 61 22 71
14 0 26 3 98
1 80 93 66 58
38 9 18 60 2
70 46 35 88 11
95 89 85 29 26
82 68 25 15 53
97 80 28 17 7
67 46 54 95 98
38 74 42 57 79
63 29 36 78 6
90 60 84 10 14
18 88 8 96 0
66 56 43 47 11
69 73 14 71 25
27 63 31 44 94
75 95 84 74 13
92 9 98 17 74
46 7 2 51 52
21 60 5 87 15
86 91 65 69 54
61 85 1 62 53
89 80 4 0 68
17 87 52 86 48
3 34 16 25 35
13 38 49 66 50
36 43 65 84 56
9 93 54 92 55
32 2 39 96 98
58 72 52 83 97
12 44 27 24 20
0 3 28 56 69
66 56 37 36 72
35 49 40 43 44
54 21 59 12 65
74 25 22 80 98
27 81 69 97 62
72 81 27 61 74
26 50 79 13 53
49 78 76 70 43
51 64 99 46 67
68 59 71 17 41
97 22 73 30 98
8 54 68 47 23
70 89 41 52 61
81 28 58 90 3
88 40 86 46 43
94 6 46 43 59
41 28 87 31 45
83 26 66 81 1
76 86 15 42 8
67 47 54 4 77
96 56 22 67 2
95 47 90 54 51
78 79 29 82 48
61 81 77 6 24
71 93 98 26 75
95 7 77 94 64
19 79 14 24 5
50 48 4 71 22
35 69 89 54 2
6 51 8 82 58
87 6 85 53 64
50 43 80 61 15
69 41 51 76 0
78 26 37 62 16
12 33 75 58 52
67 18 68 52 42
37 30 49 31 69
93 90 76 9 32
60 84 73 94 17
21 27 66 43 44
89 69 24 14 1
88 33 50 2 63
12 34 6 97 53
28 26 55 8 32
49 19 17 64 86
31 37 81 65 38
96 18 45 19 58
35 43 1 49 41
46 85 92 53 15
3 34 8 14 21
35 68 61 45 39
46 99 52 55 15
74 14 10 62 17
8 66 98 89 91
58 24 44 27 29
28 48 52 18 13
17 35 20 11 49
93 50 31 95 83
27 33 79 44 80
4 96 23 65 68
70 78 31 86 36
99 38 62 95 27
52 74 25 80 41
30 15 47 19 21
77 23 53 9 7
0 83 11 25 42
50 64 76 67 72
75 30 82 15 84
58 17 87 61 33
98 74 44 3 93
5 40 78 24 11
57 17 67 60 25
37 76 28 56 35
66 94 2 90 47
86 10 85 46 45
63 12 7 74 14
21 31 84 51 36
66 20 25 46 41
15 3 18 62 45
35 78 93 2 9
90 9 33 63 41
25 73 35 97 19
99 96 45 71 22
84 43 29 14 88
42 8 1 78 68
98 84 38 95 27
18 32 54 12 96
56 50 2 45 53
14 83 59 72 70
22 41 28 9 78
89 94 50 33 73
31 47 8 35 34
43 92 95 21 51
68 13 53 24 38
80 69 44 87 83
32 82 75 73 91
99 10 22 58 23
86 9 42 81 40
71 25 3 78 54
80 15 83 5 4
58 1 3 11 24
66 51 84 44 25
37 54 12 27 97
38 2 39 85 83
89 91 33 79 59
49 22 12 84 60
34 29 11 92 19
97 41 88 53 38
26 37 8 36 67
91 3 90 52 46
77 35 76 56 20
39 94 37 3 83
78 81 66 29 4
82 41 38 0 73
59 16 88 15 30
34 69 74 90 33
9 47 71 94 10
76 50 15 19 32
49 89 31 21 92
80 12 13 97 93
45 94 35 59 20
18 46 14 36 30
6 78 84 38 99
5 4 90 92 63
34 24 26 75 3
80 39 1 93 55
67 71 30 44 76
38 13 73 21 8
11 47 46 69 29
15 57 95 52 34
45 86 88 80 19
3 5 55 36 90
54 85 44 18 39
57 92 42 25 77
43 0 12 1 24
74 71 83 29 25
56 12 52 33 64
68 94 97 14 15
7 48 24 80 5
54 87 35 1 66
55 50 73 72 36
17 80 87 68 90
8 33 81 1 51
67 61 71 54 95
93 98 27 56 0
19 32 63 6 98
13 38 23 28 8
5 31 66 72 39
99 46 2 64 14
91 83 35 85 10
67 85 49 68 37
8 36 31 81 18
74 61 20 80 50
34 23 42 52 39
21 14 22 58 54
16 14 69 13 81
21 96 62 7 5
95 52 0 67 24
6 30 65 66 86
28 25 85 56 15
4 41 21 86 32
95 23 63 28 2
9 16 37 84 14
92 22 71 42 5
46 65 69 81 57
45 20 46 44 22
62 93 78 58 25
91 38 29 68 24
21 55 71 43 26
64 76 84 80 99
92 67 43 5 12
2 64 46 15 96
95 75 73 38 30
10 65 20 39 26
36 16 25 27 88
9 62 18 58 34
85 80 36 2 48
16 60 75 72 51
39 22 32 61 54
40 44 23 87 53
93 69 56 4 22
73 51 24 53 19
83 98 77 94 59
52 70 15 40 48
60 89 67 92 85
48 72 42 80 22
99 49 11 77 4
28 24 1 63 51
85 93 62 7 78
35 32 3 21 86
36 75 67 79 34
20 8 71 6 5
50 61 14 52 81
26 37 0 80 77
93 47 86 54 94
50 19 68 54 80
81 12 33 87 24
28 40 37 30 31
41 51 15 27 97
67 70 14 77 86
89 57 48 37 27
44 46 29 63 20
74 88 25 68 76
18 28 91 59 58
99 77 62 64 83
22 5 86 37 42
47 69 87 34 89
64 33 18 56 51
30 49 11 79 17
61 80 0 29 57
7 82 87 15 83
76 43 92 1 97
0 46 2 86 6
48 27 29 61 67
53 10 64 93 77
65 16 23 26 87
58 5 25 97 94
43 7 39 69 35
62 81 56 13 28
76 12 37 14 93
90 81 15 55 23
58 40 8 56 76
83 7 78 89 47
65 70 13 48 42
16 69 66 52 46
30 38 20 32 94
91 96 34 23 90
16 24 49 50 86
65 19 56 7 66
80 60 74 71 11
60 77 54 25 22
9 61 68 6 89
15 71 10 84 41
1 47 8 43 63
69 57 85 24 81
54 83 73 52 49
69 96 31 57 44
19 66 24 6 55
91 84 20 3 27
7 9 71 43 75
90 72 15 99 2
73 56 48 28 62
40 75 0 59 31
43 67 44 24 77
98 35 4 3 37
2 85 72 39 49
58 25 91 69 19
34 8 57 42 55
80 21 51 64 30
28 32 82 84 6
33 77 39 13 12
86 21 96 82 94
78 92 42 45 70
31 22 60 80 67
79 27 93 55 65
49 90 73 72 10
98 89 77 88 12
83 3 31 47 21
65 26 93 55 53
5 95 22 8 63
79 88 11 62 25
85 14 77 4 19
41 31 83 26 67
46 98 74 99 2
44 53 70 36 52
21 33 15 57 53
56 91 25 69 10
52 59 73 96 87
65 71 14 37 2
39 89 29 83 64
88 38 45 39 20
99 72 61 96 4
23 24 67 49 80
77 6 65 76 18
59 51 78 33 46
44 22 9 90 83
93 50 2 54 26
68 71 43 85 41
38 20 6 64 24
81 39 33 56 27
98 1 69 30 38
67 52 79 31 0
24 41 82 55 73
33 66 64 20 7
65 9 14 70 94
59 63 65 25 1
36 85 61 82 50
52 3 70 30 43
79 57 31 71 76
19 97 93 77 49
60 45 90 32 74
77 64 58 44 43
71 49 37 21 46
50 67 1 24 15
14 22 0 40 23
65 87 81 64 28
53 80 23 76 77
49 14 50 2 35
85 26 88 94 30
79 18 68 15 45
6 48 38 63 92
51 45 58 4 76
78 40 22 17 55
79 12 66 61 5
68 74 0 93 89
66 4 65 71 77
47 35 38 83 64
53 16 9 56 25
92 81 55 60 33
80 24 73 0 26
26 29 55 76 38
79 52 91 84 39
50 57 37 34 71
33 31 68 92 24
81 95 5 70 8
83 64 11 67 42
97 29 27 4 78
23 10 48 71 81
80 74 86 17 36
61 14 85 21 96
18 8 7 88 25
59 5 28 57 69
64 54 16 70 72
13 75 71 33 2
60 55 46 51 32
23 89 63 96 88
71 66 9 53 65
56 46 29 95 80
44 94 90 3 5
11 99 59 60 78
42 33 81 25 0
46 66 63 82 94
52 73 92 30 24
59 26 50 87 45
79 55 74 17 64
95 43 13 98 18
62 12 24 88 28
23 11 93 51 67
71 0 44 64 96
66 17 84 90 19
38 6 12 75 27
28 73 62 50 51
63 86 29 98 15
46 90 4 58 96
20 78 64 56 82
19 91 23 40 1
78 57 75 43 2
35 60 85 74 30
80 3 63 54 32
82 99 89 25 88
88 13 92 11 72
56 6 35 55 21
8 20 36 60 99
1 96 57 45 12
41 73 50 83 69
42 69 53 76 11
38 74 13 14 86
18 49 51 67 61
26 80 47 16 78
66 46 12 68 79
22 90 72 93 24
55 29 43 28 5
99 47 87 40 51
81 18 70 20 36
0 48 23 46 82
91 74 83 95 54
60 56 38 37 89
87 96 71 50 35
5 11 42 72 3
77 81 36 49 97
71 72 17 34 93
45 81 22 67 23
61 20 94 14 1
85 40 15 36 88
54 91 62 73 9
66 36 39 58 60
96 8 22 49 77
76 64 47 78 30
50 41 12 69 15
7 1 29 72 27
90 12 65 13 39
75 70 47 36 79
31 54 17 10 32
76 92 55 83 40
49 5 20 44 37
16 78 65 5 70
63 72 89 93 66
21 90 46 54 81
7 48 88 60 11
95 0 38 3 26
19 65 66 41 27
7 18 91 52 48
87 55 49 68 71
85 12 4 40 1
57 67 6 11 58
91 85 38 14 21
63 93 37 76 25
68 36 4 24 71
43 31 60 19 95
52 55 13 83 78

5
day_5/CHANGELOG.md Normal file
View file

@ -0,0 +1,5 @@
# Revision history for aocDay5
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.

32
day_5/aocDay5.cabal Normal file
View file

@ -0,0 +1,32 @@
cabal-version: 2.4
name: aocDay5
version: 0.1.0.0
-- A short (one-line) description of the package.
-- synopsis:
-- A longer description of the package.
-- description:
-- A URL where users can report bugs.
-- bug-reports:
license: NONE
author: Matthieu Bessat
maintainer: spamfree@matthieubessat.fr
-- A copyright notice.
-- copyright:
-- category:
extra-source-files: CHANGELOG.md
executable aocDay5
main-is: Main.hs
-- Modules included in this executable, other than Main.
-- other-modules:
-- LANGUAGE extensions used by modules in this package.
-- other-extensions:
build-depends: base ^>=4.15.0.0
hs-source-dirs: app
default-language: Haskell2010

4
day_5/app/Main.hs Normal file
View file

@ -0,0 +1,4 @@
module Main where
main :: IO ()
main = putStrLn "Hello, Haskell!"

BIN
day_5/code Normal file

Binary file not shown.

BIN
day_5/code.hi Normal file

Binary file not shown.

75
day_5/code.hs Normal file
View file

@ -0,0 +1,75 @@
import Text.Printf
import System.IO
-- getChunk :: Int -> String -> String
-- getChunk 0 subject = ("", subject)
-- getChunk len "" = ""
-- getChunk len subject =
-- let (hd, tl) = (getChunk (len-1) (tail subject))
-- (hd, (head subject) : tl)
chunksOfString :: Int -> String -> [String]
chunksOfString 0 subject = [subject]
chunksOfString len "" = []
chunksOfString len subject = do
(take len subject):(chunksOfString len (drop len subject))
splitStrOnce :: String -> String -> (String, String)
splitStrOnce separator "" = ("", "")
splitStrOnce "" subject = (subject, "")
splitStrOnce separator subject = do
let sepLen = length separator
if (take sepLen subject) == separator then
("", (drop sepLen subject))
else do
let res = splitStrOnce separator (tail subject)
(((head subject):(fst res)), (snd res))
splitStr :: String -> String -> [String]
splitStr separator "" = []
splitStr separator subject = do
let res = splitStrOnce separator subject
(fst res):(splitStr separator (snd res))
intOfString :: String -> Int
intOfString x = read x :: Int
-- addPointToDiagram :: (Int, Int) -> [[Int]]
-- rows -> columns -> diagram
makeDiagram :: Int -> Int -> [[Int]]
makeDiagram rows columns = replicate rows (replicate columns 0)
addLinesToDiagram diagram (line:remaining) =
addLinesToDiagram (addToDiagram line) remaining
where addToDiagram ((xA, yA), (xB, yB)) =
undefined
main :: IO ()
main = do
-- parse input of the day 5 of advent of code 2021
input <- getContents
let parsed = map (\(a:[b]) -> (a,b)) $ map (\x -> do {
map (\(x:[y]) -> ((intOfString x), (intOfString y)))
$ map (splitStr ",")
$ splitStr " -> " x
}) $ lines $ input
let allPoints = concat $ map (\(a,b) -> [a,b]) $ parsed
let allXs = map (\(x,y) -> x) $ allPoints
let allYs = map (\(x,y) -> y) $ allPoints
let maxX = maximum allXs
let maxY = maximum allYs
let diagram = makeDiagram (maxY+1) (maxY+1)
putStrLn (printf "diagram size: rows: %d; columns: %d" (maxY+1) (maxX+1))
diagram = map addLineToDiagram (parsed
putStrLn $ show $ allXs

BIN
day_5/code.o Normal file

Binary file not shown.

81
day_5/code.py Normal file
View file

@ -0,0 +1,81 @@
import fileinput
import pprint
def print_diagram(d):
for r in d:
for e in r:
print('.' if e == 0 else e, end='')
print('')
def parse_lines():
lines, points = [], []
for inp in fileinput.input():
val = inp.strip()
if val == '': continue
if val != '':
# quick and dirty way to parse each line (unreadable!)
a, b = list(
map(lambda pt: tuple(list(
map(int, pt.split(','))
)), val.split(' -> '))
)
points.append(a)
points.append(b)
lines.append((a, b))
return lines, points
def draw_line(diagram, a, b, mode):
step = 0
if mode == 'horizontal':
for i in range(a[0], b[0]+1):
diagram[a[1]][i] += 1
step += 1
if mode == 'vertical':
for i in range(a[1], b[1]+1):
diagram[i][a[0]] += 1
step += 1
if mode == 'diagonal':
inc = 1 if b[1] > a[1] else -1
for i in range(a[0], b[0]+1):
x, y = i, a[1]+inc*step
diagram[y][x] += 1
step += 1
return step
def count_overlap(diagram):
c = 0
for r in diagram:
for e in r:
if e >= 2: c += 1
return c
def main():
lines, points = parse_lines()
#print(points)
xs = [x for x,y in points]
ys = [y for x,y in points]
rows = max(ys)+1
columns = max(xs)+1
# create the diagram
diagram = [[0 for j in range(columns)] for i in range(rows)]
# draw lines in diagram
for a,b in lines:
mode = 'diagonal'
if a[1] == b[1]:
mode = 'horizontal'
if a[0] == b[0]:
mode = 'vertical'
if draw_line(diagram, a, b, mode) == 0:
draw_line(diagram, b, a, mode)
#print_diagram(diagram)
overlap = count_overlap(diagram)
print(overlap)
main()

View file

@ -0,0 +1,51 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -Wno-missing-safe-haskell-mode #-}
module Paths_aocDay5 (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch
version :: Version
version = Version [0,1,0,0] []
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/home/mbess/.cabal/bin"
libdir = "/home/mbess/.cabal/lib/x86_64-linux-ghc-9.0.1/aocDay5-0.1.0.0-inplace-aocDay5"
dynlibdir = "/home/mbess/.cabal/lib/x86_64-linux-ghc-9.0.1"
datadir = "/home/mbess/.cabal/share/x86_64-linux-ghc-9.0.1/aocDay5-0.1.0.0"
libexecdir = "/home/mbess/.cabal/libexec/x86_64-linux-ghc-9.0.1/aocDay5-0.1.0.0"
sysconfdir = "/home/mbess/.cabal/etc"
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
getBinDir = catchIO (getEnv "aocDay5_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "aocDay5_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "aocDay5_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "aocDay5_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "aocDay5_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "aocDay5_sysconfdir") (\_ -> return sysconfdir)
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name)

View file

@ -0,0 +1,120 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package aocDay5-0.1.0.0 */
#ifndef VERSION_aocDay5
#define VERSION_aocDay5 "0.1.0.0"
#endif /* VERSION_aocDay5 */
#ifndef MIN_VERSION_aocDay5
#define MIN_VERSION_aocDay5(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_aocDay5 */
/* package base-4.15.0.0 */
#ifndef VERSION_base
#define VERSION_base "4.15.0.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 15 || \
(major1) == 4 && (major2) == 15 && (minor) <= 0)
#endif /* MIN_VERSION_base */
/* tool gcc-11.1.0 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "11.1.0"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 11 || \
(major1) == 11 && (major2) < 1 || \
(major1) == 11 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.0.1 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.0.1"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 0 || \
(major1) == 9 && (major2) == 0 && (minor) <= 1)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.0.1 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.0.1"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 0 || \
(major1) == 9 && (major2) == 0 && (minor) <= 1)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.24.0 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.24.0"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 24 || \
(major1) == 2 && (major2) == 24 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.7 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.7"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 7)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool pkg-config-1.8.0 */
#ifndef TOOL_VERSION_pkg_config
#define TOOL_VERSION_pkg_config "1.8.0"
#endif /* TOOL_VERSION_pkg_config */
#ifndef MIN_TOOL_VERSION_pkg_config
#define MIN_TOOL_VERSION_pkg_config(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 8 || \
(major1) == 1 && (major2) == 8 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_pkg_config */
/* tool runghc-9.0.1 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.0.1"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 0 || \
(major1) == 9 && (major2) == 0 && (minor) <= 1)
#endif /* MIN_TOOL_VERSION_runghc */
/* tool strip-2.36 */
#ifndef TOOL_VERSION_strip
#define TOOL_VERSION_strip "2.36"
#endif /* TOOL_VERSION_strip */
#ifndef MIN_TOOL_VERSION_strip
#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 36 || \
(major1) == 2 && (major2) == 36 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "aocDay5-0.1.0.0-inplace-aocDay5"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1.0.0"
#endif /* CURRENT_PACKAGE_VERSION */

BIN
day_5/dist-newstyle/cache/compiler vendored Normal file

Binary file not shown.

BIN
day_5/dist-newstyle/cache/config vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
day_5/dist-newstyle/cache/improved-plan vendored Normal file

Binary file not shown.

1
day_5/dist-newstyle/cache/plan.json vendored Normal file
View file

@ -0,0 +1 @@
{"cabal-version":"3.4.0.0","cabal-lib-version":"3.4.0.0","compiler-id":"ghc-9.0.1","os":"linux","arch":"x86_64","install-plan":[{"type":"configured","id":"aocDay5-0.1.0.0-inplace-aocDay5","pkg-name":"aocDay5","pkg-version":"0.1.0.0","flags":{},"style":"local","pkg-src":{"type":"local","path":"/tmp_workspace/aoc-2021/day_5/."},"dist-dir":"/tmp_workspace/aoc-2021/day_5/dist-newstyle/build/x86_64-linux/ghc-9.0.1/aocDay5-0.1.0.0/x/aocDay5","depends":["base-4.15.0.0"],"exe-depends":[],"component-name":"exe:aocDay5","bin-file":"/tmp_workspace/aoc-2021/day_5/dist-newstyle/build/x86_64-linux/ghc-9.0.1/aocDay5-0.1.0.0/x/aocDay5/build/aocDay5/aocDay5"},{"type":"pre-existing","id":"base-4.15.0.0","pkg-name":"base","pkg-version":"4.15.0.0","depends":["ghc-bignum-1.0","ghc-prim-0.7.0","rts"]},{"type":"pre-existing","id":"ghc-bignum-1.0","pkg-name":"ghc-bignum","pkg-version":"1.0","depends":["ghc-prim-0.7.0"]},{"type":"pre-existing","id":"ghc-prim-0.7.0","pkg-name":"ghc-prim","pkg-version":"0.7.0","depends":["rts"]},{"type":"pre-existing","id":"rts","pkg-name":"rts","pkg-version":"1.0","depends":[]}]}

BIN
day_5/dist-newstyle/cache/solver-plan vendored Normal file

Binary file not shown.

BIN
day_5/dist-newstyle/cache/source-hashes vendored Normal file

Binary file not shown.

BIN
day_5/dist-newstyle/cache/up-to-date vendored Normal file

Binary file not shown.

Binary file not shown.

10
day_5/example.txt Normal file
View file

@ -0,0 +1,10 @@
0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -> 8,8
5,5 -> 8,2

501
day_5/input.txt Normal file
View file

@ -0,0 +1,501 @@
976,35 -> 24,987
552,172 -> 870,490
647,640 -> 841,834
580,460 -> 580,749
614,575 -> 746,575
97,846 -> 441,846
467,680 -> 767,680
722,860 -> 722,98
31,338 -> 31,581
113,712 -> 184,712
738,897 -> 136,897
820,750 -> 144,74
291,411 -> 641,411
581,878 -> 581,657
449,540 -> 787,202
79,925 -> 981,23
800,120 -> 36,884
253,603 -> 253,643
574,138 -> 574,966
847,199 -> 144,902
816,177 -> 243,750
963,632 -> 472,141
38,41 -> 986,989
980,225 -> 980,801
255,350 -> 647,350
732,311 -> 732,907
109,662 -> 113,662
333,317 -> 470,180
111,146 -> 339,146
136,856 -> 534,458
555,39 -> 555,895
699,327 -> 699,496
280,948 -> 660,948
919,293 -> 316,896
343,645 -> 620,368
14,984 -> 975,23
219,653 -> 696,176
50,350 -> 50,956
919,550 -> 919,568
405,532 -> 238,532
328,95 -> 979,746
564,716 -> 119,716
52,285 -> 52,126
240,671 -> 963,671
691,416 -> 676,431
216,247 -> 216,530
103,309 -> 103,643
265,163 -> 981,879
623,399 -> 760,262
392,568 -> 674,286
280,82 -> 863,665
657,522 -> 657,858
194,16 -> 443,16
158,326 -> 158,372
582,530 -> 582,159
857,638 -> 857,807
463,575 -> 463,108
74,390 -> 74,967
437,892 -> 224,892
854,409 -> 366,897
875,858 -> 875,871
245,683 -> 735,193
911,285 -> 216,980
944,170 -> 701,170
149,244 -> 149,653
879,926 -> 70,117
193,198 -> 777,782
11,581 -> 287,305
513,163 -> 939,163
551,705 -> 551,636
546,79 -> 546,630
392,877 -> 392,240
859,821 -> 859,975
755,581 -> 755,722
941,636 -> 976,636
212,807 -> 595,807
24,847 -> 24,248
972,46 -> 40,978
434,328 -> 491,328
573,663 -> 16,663
882,43 -> 882,777
162,786 -> 11,786
774,340 -> 322,340
33,775 -> 883,775
422,958 -> 212,748
973,879 -> 415,321
278,602 -> 435,759
983,99 -> 321,99
594,502 -> 727,635
755,674 -> 314,233
67,336 -> 702,336
617,128 -> 617,287
735,929 -> 165,929
758,778 -> 758,679
38,27 -> 971,960
873,419 -> 949,419
305,138 -> 978,811
282,404 -> 377,404
753,267 -> 945,267
877,796 -> 64,796
35,32 -> 949,946
18,383 -> 64,429
855,407 -> 938,324
845,965 -> 88,208
77,960 -> 960,77
225,714 -> 490,714
619,40 -> 395,40
87,379 -> 87,178
961,828 -> 302,828
78,321 -> 78,816
243,620 -> 883,620
581,560 -> 69,560
420,957 -> 768,957
927,427 -> 908,408
100,406 -> 100,736
369,27 -> 199,27
177,804 -> 177,727
83,807 -> 166,724
358,119 -> 358,583
866,223 -> 348,741
283,636 -> 283,476
792,481 -> 161,481
126,476 -> 612,962
829,437 -> 829,444
402,683 -> 402,11
680,278 -> 676,278
391,597 -> 521,467
467,787 -> 646,608
637,689 -> 637,959
161,173 -> 161,604
582,252 -> 582,181
971,93 -> 329,93
763,195 -> 156,802
576,504 -> 755,325
156,56 -> 657,557
276,940 -> 836,380
800,933 -> 800,734
486,607 -> 486,54
847,679 -> 299,131
558,711 -> 558,643
44,869 -> 44,877
897,399 -> 897,265
856,217 -> 856,701
395,784 -> 395,634
443,647 -> 443,977
59,735 -> 59,860
564,519 -> 173,910
516,860 -> 54,860
23,467 -> 23,551
82,102 -> 849,869
316,551 -> 195,551
943,41 -> 25,959
314,865 -> 314,74
434,491 -> 501,491
941,563 -> 860,563
937,842 -> 320,225
415,725 -> 415,841
822,308 -> 500,308
136,434 -> 22,434
275,356 -> 280,356
672,935 -> 22,935
776,22 -> 55,743
219,198 -> 219,775
977,923 -> 977,344
37,922 -> 815,144
107,493 -> 107,804
840,913 -> 840,686
249,774 -> 249,485
765,696 -> 649,696
491,708 -> 302,708
345,589 -> 345,357
935,206 -> 759,206
757,823 -> 30,96
590,513 -> 746,513
373,18 -> 845,490
816,829 -> 816,608
104,15 -> 964,875
650,675 -> 650,389
333,987 -> 857,463
627,398 -> 627,223
578,208 -> 159,208
355,594 -> 355,633
63,921 -> 873,921
510,434 -> 801,143
953,928 -> 308,283
947,48 -> 25,970
384,203 -> 384,97
806,160 -> 934,288
690,29 -> 269,29
825,834 -> 269,278
620,613 -> 620,540
554,698 -> 419,833
887,554 -> 457,554
276,573 -> 276,487
213,211 -> 213,619
437,621 -> 141,917
951,59 -> 951,272
270,455 -> 270,336
727,25 -> 42,710
803,384 -> 615,196
643,715 -> 643,741
750,815 -> 642,923
464,693 -> 714,943
828,773 -> 189,134
507,858 -> 58,858
289,898 -> 190,898
380,518 -> 749,149
696,219 -> 760,219
678,177 -> 686,185
241,103 -> 857,103
782,773 -> 782,508
20,24 -> 277,281
175,805 -> 59,805
375,944 -> 375,938
180,971 -> 203,971
379,984 -> 830,984
298,376 -> 254,376
807,376 -> 486,376
931,512 -> 931,931
889,859 -> 361,859
632,546 -> 298,880
429,616 -> 583,770
814,838 -> 503,527
64,301 -> 753,301
706,124 -> 706,698
323,976 -> 323,43
42,82 -> 550,590
260,528 -> 260,462
201,656 -> 593,656
348,516 -> 203,516
201,675 -> 413,675
928,70 -> 138,860
323,427 -> 601,427
874,156 -> 630,156
335,374 -> 335,522
237,551 -> 597,551
14,125 -> 909,125
805,59 -> 67,797
656,684 -> 656,263
487,544 -> 487,464
637,890 -> 637,606
27,983 -> 952,58
899,93 -> 77,915
504,288 -> 504,689
404,289 -> 700,289
643,336 -> 321,336
190,865 -> 674,865
844,12 -> 81,775
821,365 -> 821,453
503,20 -> 503,811
20,122 -> 983,122
28,231 -> 398,231
441,263 -> 931,263
130,19 -> 925,19
577,873 -> 577,706
322,489 -> 322,621
269,134 -> 935,800
61,841 -> 491,841
286,720 -> 542,464
497,530 -> 497,266
178,616 -> 512,282
184,338 -> 184,241
906,946 -> 327,946
879,947 -> 879,302
815,788 -> 963,788
791,322 -> 791,395
851,116 -> 793,116
232,114 -> 934,816
273,839 -> 157,839
184,876 -> 184,138
298,586 -> 634,250
130,127 -> 130,753
453,485 -> 855,887
663,776 -> 934,776
799,326 -> 799,661
56,498 -> 274,716
650,317 -> 52,915
93,342 -> 391,44
972,22 -> 59,935
761,78 -> 508,331
577,578 -> 15,16
51,902 -> 72,881
51,91 -> 51,422
89,602 -> 89,280
339,129 -> 339,329
173,413 -> 489,413
756,383 -> 745,383
216,39 -> 216,373
844,404 -> 552,404
313,276 -> 313,895
236,330 -> 231,330
836,496 -> 836,291
18,48 -> 950,980
562,408 -> 562,606
70,105 -> 70,469
402,458 -> 694,166
228,644 -> 689,183
220,646 -> 834,32
691,734 -> 141,184
24,974 -> 978,20
805,111 -> 11,905
765,765 -> 210,210
265,810 -> 248,810
742,506 -> 179,506
945,954 -> 40,49
403,464 -> 600,464
149,784 -> 754,784
784,757 -> 222,757
905,839 -> 160,839
660,971 -> 609,971
148,505 -> 309,505
571,494 -> 323,494
573,109 -> 71,109
513,649 -> 54,649
287,582 -> 287,604
569,218 -> 569,790
108,740 -> 108,816
542,899 -> 445,802
939,519 -> 939,752
810,643 -> 810,236
571,95 -> 560,106
547,431 -> 547,42
299,536 -> 299,820
506,808 -> 437,808
727,803 -> 941,589
583,100 -> 891,100
552,556 -> 515,556
789,871 -> 90,172
81,649 -> 641,89
264,518 -> 511,518
498,324 -> 596,324
642,836 -> 642,481
695,827 -> 768,900
603,940 -> 603,352
975,64 -> 92,947
65,515 -> 65,405
766,667 -> 344,667
284,162 -> 245,162
139,123 -> 942,926
316,906 -> 316,907
42,418 -> 224,600
338,733 -> 338,46
448,744 -> 448,796
198,153 -> 198,723
122,433 -> 712,433
887,708 -> 685,708
452,265 -> 817,630
317,613 -> 317,959
185,841 -> 788,238
702,558 -> 734,558
45,749 -> 330,464
250,174 -> 250,561
276,664 -> 793,664
164,434 -> 619,434
360,13 -> 686,339
52,333 -> 361,642
315,675 -> 315,175
646,530 -> 815,699
363,554 -> 58,554
730,80 -> 38,772
90,85 -> 494,85
863,64 -> 218,64
633,492 -> 633,134
321,919 -> 324,919
395,133 -> 395,592
152,963 -> 983,132
42,149 -> 674,781
754,146 -> 858,146
53,628 -> 976,628
433,365 -> 433,735
951,360 -> 951,913
875,250 -> 875,463
923,348 -> 208,348
951,586 -> 103,586
818,924 -> 178,284
265,130 -> 265,859
26,410 -> 805,410
847,149 -> 190,806
136,36 -> 797,36
841,660 -> 620,660
759,553 -> 393,919
530,743 -> 647,860
163,909 -> 979,93
798,175 -> 399,574
934,847 -> 934,231
373,749 -> 373,397
679,871 -> 695,887
407,468 -> 524,468
890,611 -> 988,611
104,706 -> 745,65
533,659 -> 533,126
342,460 -> 187,460
398,26 -> 398,254
116,11 -> 886,781
846,317 -> 329,834
919,104 -> 120,903
93,843 -> 912,24
618,610 -> 618,311
834,276 -> 85,276
983,26 -> 42,967
412,706 -> 412,204
51,966 -> 952,65
969,871 -> 969,258
51,652 -> 608,95
289,903 -> 869,903
283,760 -> 781,760
521,74 -> 521,848
720,572 -> 638,572
146,847 -> 146,930
980,953 -> 42,15
49,956 -> 941,64
209,242 -> 905,242
249,185 -> 374,60
916,738 -> 916,793
12,922 -> 872,62
543,198 -> 123,198
316,423 -> 316,549
694,514 -> 869,514
36,46 -> 916,926
427,295 -> 267,295
884,669 -> 884,175
558,379 -> 549,379
89,85 -> 968,964
48,544 -> 48,675
337,81 -> 337,870
953,46 -> 44,955
37,912 -> 251,698
342,191 -> 342,238
874,289 -> 353,810
547,935 -> 97,485
392,359 -> 859,826
329,815 -> 329,98
65,22 -> 118,75
803,341 -> 803,763
389,98 -> 964,98
420,520 -> 396,520
204,650 -> 583,650
446,77 -> 739,77
208,447 -> 75,580
693,443 -> 693,668
341,697 -> 802,697
398,718 -> 318,638
430,38 -> 430,665
519,932 -> 490,932
381,492 -> 242,353
896,616 -> 638,616
520,552 -> 901,933
750,44 -> 307,44
653,209 -> 186,676
399,447 -> 208,256
741,146 -> 741,399
228,893 -> 228,214
934,925 -> 71,62
986,74 -> 74,986
422,88 -> 467,43
566,680 -> 875,371
328,465 -> 38,465
705,620 -> 705,441
534,256 -> 534,784
909,939 -> 909,222
467,640 -> 323,640
372,725 -> 816,281
78,631 -> 78,933
739,376 -> 397,718
901,954 -> 153,206
869,212 -> 799,212
192,946 -> 192,736
946,13 -> 13,946
267,480 -> 267,561
954,287 -> 954,190
145,935 -> 913,167
295,152 -> 458,152
10,690 -> 139,690
121,23 -> 977,879
265,247 -> 265,976
281,793 -> 787,793
988,355 -> 367,976
97,807 -> 323,807
527,506 -> 474,506
359,340 -> 359,280
371,203 -> 801,203
53,593 -> 53,980
377,705 -> 987,95
901,975 -> 153,227
851,442 -> 565,442
425,976 -> 850,551
766,674 -> 766,572
18,757 -> 18,444
386,682 -> 386,424
966,640 -> 604,278
919,973 -> 141,195
672,768 -> 405,768
271,814 -> 971,114
719,902 -> 474,902
365,768 -> 877,256
360,787 -> 214,787
133,616 -> 266,483
577,399 -> 59,399
290,74 -> 290,145
154,131 -> 154,210