import math proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: var k = getchar_unlocked() if k < '0' or k > '9': break else: result = 10 * result + k.ord - '0'.ord # 15 35 => 50 15*35 # 5*(3 7 =>) let a = scan() let b = scan() let g = a.gcd(b) echo g # echo (a+b).gcd(a*b)