import java.io.*; import java.util.*; import java.lang.*; public class copier { // take an array, return the first two values in opposite places private static int[] flip(int[] array) { int[] temp = {array[1],array[0]}; return temp; } // return the percent we must scale the image to fit it on the page private static int percentScale(int[] image, int[] page) { int xscale = 100; if(page[0] < image[0]) xscale = 100*page[0]/image[0]; int yscale = 100; if(page[1] < image[1]) yscale = 100*page[1]/image[1]; return Math.min(xscale,yscale); } public static void main(String[] args) { // create our stdin reader BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter stdout = new BufferedWriter(new OutputStreamWriter(System.out)); // for each input of dimensions while(true) { // this will hold the numbers (as strings) String[] str_dim; // try to read in the line try { str_dim = stdin.readLine().split(" "); } catch(IOException e) { System.out.println(e); break; } // put the x,y of the image into image_dim, and ditto with the page int[] image_dim = {Integer.parseInt(str_dim[0]),Integer.parseInt(str_dim[1])}; int[] page_dim = {Integer.parseInt(str_dim[2]),Integer.parseInt(str_dim[3])}; // if it starts with zero, we're done (leave) if(image_dim[0] == 0) break; // try to write the answer try { System.out.print(Math.max(percentScale(image_dim,page_dim), percentScale(flip(image_dim),page_dim))); System.out.print("%\n"); stdout.write(Math.max(percentScale(image_dim,page_dim), percentScale(flip(image_dim),page_dim))); stdout.write("%\n"); } catch(IOException e) { System.out.println(e); break; } } } }