import sequtils,strutils,algorithm,math,sugar,macros,strformat template `min=`*(x,y) = x = min(x,y) proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: var k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord let AB = (proc():seq[seq[int]] = const INF = 1e4.int var AB = newSeqWith(101,newSeqWith(101,INF)) for a in 0..<100: for b in 0..<100: if a == b and b == 0 : continue let c = ((100 * a) / (a + b)).round().int let d = ((100 * b) / (a + b)).round().int AB[c][d] .min= a + b return AB )() let a = scan() let b = scan() echo AB[a][b]