-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathI037.java
More file actions
29 lines (24 loc) · 939 Bytes
/
I037.java
File metadata and controls
29 lines (24 loc) · 939 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
package levelB;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class I037 {
public static void main(String[] args) throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] str=br.readLine().split(" ");
br.close();
String[] temp=str[0].split("\\.");
long P=Integer.parseInt(temp[0])*17*29+Integer.parseInt(temp[1])*29+Integer.parseInt(temp[2]);
temp=str[1].split("\\.");
long A=Integer.parseInt(temp[0])*17*29+Integer.parseInt(temp[1])*29+Integer.parseInt(temp[2]);
long cha=A-P;
if(cha<0){
System.out.print("-");
cha=-cha;
}
long Galleon,Sickle,Knut;
Galleon=cha/29/17;
Sickle=(cha-Galleon*29*17)/29;
Knut=cha-Galleon*29*17-Sickle*29;
System.out.print(Galleon+"."+Sickle+"."+Knut);
}
}