-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary_Fine.cpp
More file actions
51 lines (38 loc) · 893 Bytes
/
Library_Fine.cpp
File metadata and controls
51 lines (38 loc) · 893 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
/**
* Title : Library_Fine.cpp
* Author : Tridib Samanta
* Created : 24-03-2020
* Link : https://www.hackerrank.com/challenges/library-fine/problem
**/
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cstdlib>
#include <map>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int d1,m1,y1,d2,m2,y2;
cin>> d1 >> m1 >> y1;
cin>> d2 >> m2 >> y2;
int fine;
if(y1 > y2)
fine = 10000;
else if (y1 == y2) {
if(m1 > m2)
fine = 500 * (m1 - m2);
else if(m1 == m2)
(d1 <= d2) ? (fine = 0) : (fine = 15 * (d1 - d2));
else
fine = 0;
}
else
fine = 0;
cout<< fine << "\n";
return 0;
}