-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbazen.java
More file actions
63 lines (56 loc) · 968 Bytes
/
Copy pathbazen.java
File metadata and controls
63 lines (56 loc) · 968 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import java.util.*;
public class bazen {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int y = scan.nextInt();
int temp;
boolean rotated = false;
double xf , yf , b;
if (! (x == 0 || y == 0))
{
if (y >= x)
{
b = 31250.0 / y;
xf = 250 - b; yf = 0;
}
else
{
b = 31250.0 / x;
yf = 250 - b; xf = 0;
}
}
else
{
if (x == 0)
{
temp = x;
x = y;
y = temp;
rotated = true;
}
if (x <= 125)
{
b = 250 - x;
yf = 31250.0 / b;
xf = 250 - yf;
}
else
{
b = x;
yf = 31250.0 / b;
xf = 0;
}
if (rotated)
{
b = xf;
xf = yf;
yf = b;
}
}
System.out.printf("%.2f" , xf);
System.out.print(" ");
System.out.printf("%.2f" , yf);
scan.close();
}
}