-
Notifications
You must be signed in to change notification settings - Fork 0
/
libraryFine.java
33 lines (31 loc) · 896 Bytes
/
libraryFine.java
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
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class libraryFine {
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 scan = new Scanner(System.in);
int fine = 0;
int D = scan.nextInt();
int M = scan.nextInt();
int Y = scan.nextInt();
int eD = scan.nextInt();
int eM = scan.nextInt();
int eY = scan.nextInt();
if(((D <= eD)&&(M<=eM)&&(Y<=eY))){
fine = 0;
}
else if((D>eD)&&(M==eM)&&(Y==eY)){
fine = 15*(D-eD);
}
else if((M>eM)&&(Y==eY)){
fine = 500*(M-eM);
}
else if(Y>eY){
fine = 10000;
}
System.out.println(fine);
}
}