{"problem":{"name":"G. Perfectionist Arkadiy","description":{"content":"Arkadiy has lots square photos with size _a_ × _a_. He wants to put some of them on a rectangular wall with size _h_ × _w_. The photos which Arkadiy will put on the wall must form a rectangular grid ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF774G"},"statements":[{"statement_type":"Markdown","content":"Arkadiy has lots square photos with size _a_ × _a_. He wants to put some of them on a rectangular wall with size _h_ × _w_.\n\nThe photos which Arkadiy will put on the wall must form a rectangular grid and the distances between neighboring vertically and horizontally photos and also the distances between outside rows and columns of photos to the nearest bound of the wall must be equal to _x_, where _x_ is some non-negative **real** number. Look on the picture below for better understanding of the statement.\n\n<center>![image](https://espresso.codeforces.com/a732e2b47d768b7f609ec4bd187f2a057170ad61.png)</center>Arkadiy haven't chosen yet how many photos he would put on the wall, however, he want to put at least one photo. Your task is to determine the **minimum** value of _x_ which can be obtained after putting photos, or report that there is no way to put positive number of photos and satisfy all the constraints. Suppose that Arkadiy has enough photos to make any valid arrangement according to the constraints.\n\nNote that Arkadiy wants to put at least one photo on the wall. The photos should not overlap, should completely lie inside the wall bounds and should have sides parallel to the wall sides.\n\n## Input\n\nThe first line contains three integers _a_, _h_ and _w_ (1 ≤ _a_, _h_, _w_ ≤ 109) — the size of photos and the height and the width of the wall.\n\n## Output\n\nPrint one non-negative real number — the minimum value of _x_ which can be obtained after putting the photos on the wall. The absolute or the relative error of the answer must not exceed 10 - 6.\n\nPrint _\\-1_ if there is no way to put positive number of photos and satisfy the constraints.\n\n[samples]\n\n## Note\n\nIn the first example Arkadiy can put 7 rows of photos with 5 photos in each row, so the minimum value of _x_ equals to 0.5.\n\nIn the second example Arkadiy can put only 1 photo which will take the whole wall, so the minimum value of _x_ equals to 0.\n\nIn the third example there is no way to put positive number of photos and satisfy the constraints described in the statement, so the answer is _\\-1_.","is_translate":false,"language":"English"}],"meta":{"iden":"CF774G","tags":["number theory"],"sample_group":[["2 18 13","0.5"],["4 4 4","0"],["3 4 3","\\-1"]],"created_at":"2026-03-03 11:00:39"}}