# frozen_string_literal: true MAX = 1000 # solve # # NOTE: `return...` and `(1..max)` is necessary # in order to avoid zero division. def solve return 0 if A.zero? && B.zero? (0..MAX).find do |max| (1..max).any? do |a| b = max - a A == Rational(100 * a, a + b).round && B == Rational(100 * b, a + b).round end end end A, B = gets.split.map(&:to_i) puts solve