blob: adc7e869a3ed110ab124838810a71f2e73748996 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import os, strutils
let input = paramStr(1)
var done: bool = false
for one in lines(input):
for two in lines(input):
if parseInt(one) + parseInt(two) == 2020 and not done:
echo parseInt(one) * parseInt(two)
done = true
for three in lines(input):
if parseInt(one) + parseInt(two) + parseInt(three) == 2020 and done:
echo parseInt(one) * parseInt(two) * parseInt(three)
quit()
|