Skip to content

Commit 93bac56

Browse files
committed
Add problem from CF
1 parent e5f96e5 commit 93bac56

File tree

2 files changed

+23
-1
lines changed
  • codeforces
    • Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined)

2 files changed

+23
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// http://codeforces.com/contest/765/problem/C
2+
3+
#include<bits/stdc++.h>
4+
using namespace std;
5+
6+
#define endl '\n'
7+
#define D(x) cout << #x << " = " << (x) << endl;
8+
9+
int main() {
10+
int k, a, b;
11+
cin >> k >> a >> b;
12+
13+
int aa = a / k;
14+
int bb = b / k;
15+
16+
int ans = (a / k) + (b / k);
17+
if (a % k != 0 && !bb || b % k != 0 && !aa) cout << -1 << endl;
18+
else cout << ans << endl;
19+
20+
return 0;
21+
}

codeforces/data.db

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,4 +934,5 @@
934934
24577407
935935
24578991
936936
24681844
937-
24682004
937+
24682004
938+
24699903

0 commit comments

Comments
 (0)