Skip to content

Commit 06c0ce2

Browse files
authored
Merge pull request #81 from Dimas-Saputra-Me/master
Adding Google KickStart solution in C++
2 parents a1a85d2 + 2b4c68c commit 06c0ce2

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main(){
5+
int a;
6+
cin >> a;
7+
8+
for(long int i=1; i<=a; i++){
9+
long int n, k, s;
10+
cin >> n >> k >> s;
11+
12+
long int answer = min((k + n), ((k - s) + (n - s) + (k - 1) + 1));
13+
cout << "Case #" << i << ": " << answer << endl;
14+
}
15+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2
2+
10 5 2
3+
10 7 6
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Case #1: 15
2+
Case #2: 12

0 commit comments

Comments
 (0)