package no339; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int p = sc.nextInt(); int q = sc.nextInt(); for(int sum=1;;sum++) { for(int a=0;a<=sum;a++) { int b = sum - a; int p2 = divRound(100 * a, a + b); int q2 = divRound(100 * b, a + b); if (p == p2 && q == q2) { System.out.println(sum); return; } } } } public static int divRound(int a,int b) { return a / b + (a % b >= (b + 1) / 2 ? 1 : 0); } }