-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLibraryFine.cpp
More file actions
63 lines (48 loc) · 896 Bytes
/
LibraryFine.cpp
File metadata and controls
63 lines (48 loc) · 896 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
52
53
54
55
56
57
58
59
60
61
62
63
// problem: "https://www.hackerrank.com/challenges/library-fine/problem"
#include<iostream>
using namespace std;
int main()
{
int D[2],M[2],Y[2],n;
n=-1;
cin>>D[0]>>M[0]>>Y[0];
cin>>D[1]>>M[1]>>Y[1];
if(Y[0]<Y[1])
{
cout<<0;
n=0;
}
else if(Y[0]==Y[1])
{
if(M[0]<M[1])
{
cout<<0;
n=0;
}
else if(M[0]==M[1])
{
if(D[0]<=D[1])
{
cout<<0;
n=0;
}
}
else
n=-1;
}
else
n=-1;
if(n!=0)
{
if(Y[0]>Y[1])
cout<<10000;
else
{
if(M[0]>M[1])
cout<<(M[0]-M[1])*500;
else
cout<<(D[0]-D[1])*15;
}
}
return 0;
}