-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDay26.java
35 lines (29 loc) · 928 Bytes
/
Day26.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
34
35
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int returned_date = sc.nextInt();
int returned_month = sc.nextInt();
int returned_year = sc.nextInt();
int due_date = sc.nextInt();
int due_month = sc.nextInt();
int due_year = sc.nextInt();
int fine = 0;
if(returned_year < due_year){
fine = 0;
}
else{
if(returned_year > due_year ){
fine = 10000;
}
else if(returned_month > due_month){
fine = 500*(returned_month - due_month);
}
else if(returned_date > due_date){
fine = 15*(returned_date - due_date);
}
}
System.out.println(fine);
}
}