forked from NemrudDemir/HackerRank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution.cs
More file actions
60 lines (44 loc) · 1.44 KB
/
Solution.cs
File metadata and controls
60 lines (44 loc) · 1.44 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
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
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using System.Text;
using System;
class Solution {
// Complete the libraryFine function below.
static int libraryFine(int d1, int m1, int y1, int d2, int m2, int y2) {
if(y1 > y2)
return 10000;
if(y2 > y1)
return 0;
if(m1 > m2)
return (m1-m2)*500;
if(m2 > m1)
return 0;
if(d1 > d2)
return (d1-d2)*15;
return 0;
}
static void Main(string[] args) {
TextWriter textWriter = new StreamWriter(@System.Environment.GetEnvironmentVariable("OUTPUT_PATH"), true);
string[] d1M1Y1 = Console.ReadLine().Split(' ');
int d1 = Convert.ToInt32(d1M1Y1[0]);
int m1 = Convert.ToInt32(d1M1Y1[1]);
int y1 = Convert.ToInt32(d1M1Y1[2]);
string[] d2M2Y2 = Console.ReadLine().Split(' ');
int d2 = Convert.ToInt32(d2M2Y2[0]);
int m2 = Convert.ToInt32(d2M2Y2[1]);
int y2 = Convert.ToInt32(d2M2Y2[2]);
int result = libraryFine(d1, m1, y1, d2, m2, y2);
textWriter.WriteLine(result);
textWriter.Flush();
textWriter.Close();
}
}