-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContest911B.java
More file actions
36 lines (33 loc) · 1 KB
/
Copy pathContest911B.java
File metadata and controls
36 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import condeforce.*;
import java.util.Scanner;
/**
*
* @author rn-sshawish
*/
public class Contest911B {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int plate = input.nextInt();
int a = input.nextInt();
int b = input.nextInt();
double sume = a + b;
double aPersentage = Math.round(((a*10)/sume))/10.0;
double pPersentage = Math.round(((b*10)/sume))/10.0;
int x =(int) Math.round(plate*aPersentage);
int y =(int)Math.round(plate*pPersentage);
if (x == 0) {
x =1;
y --;
}else if(y == 0){
y =1;
x--;
}
int min = a % x == 0? a/x : (int)Math.ceil(a/x*1.0);
System.out.println(Math.min(min, b%y == 0? b/y : (int)Math.ceil(b/y*1.0)));
}
}