-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary.java
More file actions
32 lines (29 loc) · 1.03 KB
/
library.java
File metadata and controls
32 lines (29 loc) · 1.03 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
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
int Dactual = sc.nextInt();
int Mactual = sc.nextInt();
int Yactual = sc.nextInt();
int Dexpected = sc.nextInt();
int Mexpected = sc.nextInt();
int Yexpected = sc.nextInt();
//int cost;
//int fine;
int daysLate = Dactual - Dexpected;
int monthsLate = Mactual - Mexpected;
if ( (Yactual - Yexpected) < 0 ){
System.out.println('0');
return;
} else if (monthsLate < 0 && (Yactual - Yexpected) == 0){
System.out.println('0');
return;
}
System.out.println((Yactual - Yexpected != 0) ? 10000
: (monthsLate > 0) ? monthsLate * 500
: (daysLate > 0) ? daysLate * 15
: 0);
}
}