buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
def solve(): A,B,N = map(int, input().split()) if N < B: print((A*N)//B - A * (N//B)) else: print(((A*(N-1))//B) - A* ((N-1)//B)) if __name__ == "__main__": solve()
def solve(): A,B,N = map(int, input().split()) if N < B-1: print((A*N)//B - A * (N//B)) else: print(((A*(B-1))//B) - A* ((B-1)//B)) if __name__ == "__main__": solve()
[["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612], ["-", 31, 23, 0, 657, 12, 23, 0, 657, 31, 22], ["+", 31, 23, 0, 657, 12, 23, 0, 657, 31, 22], ["-", 12, 23, 0, 657, 31, 23, 0, 657, 31, 22], ["+", 12, 23, 0, 657, 31, 23, 0, 657, 31, 22]]
5
86
A,B,N =list(map(int,input().split())) kai = 0 if B < N: kai = int(A*(B-1)/B) else: kai = int(A*N/B) print(kai)
A,B,N =list(map(int,input().split())) kai = 0 if B <= N: kai = int(A*(B-1)/B) else: kai = int(A*N/B) print(kai)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
59
import math A, B, N = [int(x) for x in input().split()] count = min(B, N) a = math.floor(float(A*count)/B) - A * math.floor(float(count)/B) print(a)
import math A, B, N = [int(x) for x in input().split()] count = min(B-1, N) a = math.floor(float(A*count)/B) - A * math.floor(float(count)/B) print(a)
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
65
#include <bits/stdc++.h> #include <cmath> #define pb push_back #define ld long double #define mp make_pair #define vl vector<ll> #define vd vector<double> #define vld vector<long double> #define ll long long int #define pl pair<ll, ll> #define all(a) a.begin(), a.end() #define forr(i, n) for (ll i = 0; i < n; i++) #def...
#include <bits/stdc++.h> #include <cmath> #define pb push_back #define ld long double #define mp make_pair #define vl vector<ll> #define vd vector<double> #define vld vector<long double> #define ll long long int #define pl pair<ll, ll> #define all(a) a.begin(), a.end() #define forr(i, n) for (ll i = 0; i < n; i++) #def...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]]
1
133
#include <algorithm> #include <cfenv> #include <cmath> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdlib.h> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define vint vector<int> #defi...
#include <algorithm> #include <cfenv> #include <cmath> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdlib.h> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define vint vector<int> #defi...
[["+", 31, 23, 0, 16, 12, 23, 0, 2, 63, 22], ["+", 0, 16, 12, 23, 0, 2, 3, 4, 0, 24], ["+", 0, 16, 12, 23, 0, 2, 3, 4, 0, 21], ["+", 0, 16, 12, 23, 0, 2, 3, 4, 0, 22], ["+", 0, 16, 12, 23, 0, 2, 3, 4, 0, 25]]
1
105
//#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <vector> using namespace std; ...
//#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <vector> using namespace std; ...
[["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
290
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef vector<int> vi; int main(void) { ll A, B, N; cin >> A >> B >> N; ll c = 0; if (B < N) { c = (A * (B - 1)) / B - A * ((B - 1) / B); } else { c = (A * N) / B - A * (N / B); } cout << c; return 0; }
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef vector<int> vi; int main(void) { ll A, B, N; cin >> A >> B >> N; ll c = 0; if (B <= N) { c = (A * (B - 1)) / B - A * ((B - 1) / B); } else { c = (A * N) / B - A * (N / B); } cout << c; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
109
#include <bits/stdc++.h> using namespace std; int main() { int A; long long int B, N; cin >> A >> B >> N; if (N > B) N = B; cout << floor(A * N / B) - A * (N / B) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int A; long long int B, N; cin >> A >> B >> N; if (N > B - 1) N = B - 1; cout << floor(A * N / B) - A * (N / B) << endl; return 0; }
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]]
1
64
A, B, N = map(int, input().split()) if(N > B): x = B - 1 else: x = N ''' print(x) ''' print((A * x) // B - A * (x//B))
A, B, N = map(int, input().split()) if(N >= B): x = B - 1 else: x = N ''' print(x) ''' print((A * x) // B - A * (x//B))
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20]]
5
56
#include <bits/stdc++.h> using namespace std; long long int a, b, n; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> a >> b >> n; n = max(n, b - 1); cout << (a * n) / b; }
#include <bits/stdc++.h> using namespace std; long long int a, b, n; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> a >> b >> n; n = min(n, b - 1); cout << (a * n) / b; }
[["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22]]
1
71
a, b, n = map(int, input().split()) if b >= n: x = n else: x = b - 1 print(int(a * x / b) - a * int(x / b))
a, b, n = map(int, input().split()) if b > n: x = n else: x = b - 1 print(int(a * x / b) - a * int(x / b))
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
53
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int64_t A, B, N; cin >> A >> B >> N; int64_t x = N; if (B - 1 < x) x = x - 1; int64_t ans; ans = A * x / B - A * (x / B); cout << ans << endl; return 0; }
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int64_t A, B, N; cin >> A >> B >> N; int64_t x = N; if (B - 1 < x) x = B - 1; int64_t ans; ans = A * x / B - A * (x / B); cout << ans << endl; return 0; }
[["-", 0, 57, 64, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 31, 22]]
1
76
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) typedef long long ll; typedef pair<int, int> P; const int INF = 100100100; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; template <class T> inline bool chmax(T...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) typedef long long ll; typedef pair<int, int> P; const int INF = 100100100; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; template <class T> inline bool chmax(T...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 31, 22], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 31, 22]]
1
152
import java.io.*; import java.util.*; public class Main { public static void solve(InputReader in) { long a = in.readLong(); long b = in.readLong(); long n = in.readLong(); long min = Math.min(b - 1, n); System.out.println((min * a) / b - (a * min / b)); } public static void main(String... st...
import java.io.*; import java.util.*; public class Main { public static void solve(InputReader in) { long a = in.readLong(); long b = in.readLong(); long n = in.readLong(); long min = Math.min(b - 1, n); System.out.println((min * a) / b - (a * (min / b))); } public static void main(String... ...
[["+", 0, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
3
605
import math def main(): a, b, n = map(int, input().split()) x = n-1 if b-1 > n else b-1 print(math.floor(a*x/b)-a*math.floor(x/b)) if __name__ == '__main__': main()
import math def main(): a, b, n = map(int, input().split()) x = n if (b-1) > n else b-1 print(math.floor(a*x/b)-a*math.floor(x/b)) if __name__ == '__main__': main()
[["-", 0, 1, 0, 662, 12, 41, 0, 657, 17, 33], ["-", 0, 1, 0, 662, 12, 41, 0, 657, 12, 612], ["+", 0, 662, 12, 41, 0, 666, 0, 23, 0, 24], ["+", 0, 662, 12, 41, 0, 666, 0, 23, 0, 25]]
5
74
A,B,N = map(int,input().split()) if N >= B: N = N - 1 ans = int(A * N / B) - A * int(N / B) print(ans)
A,B,N = map(int,input().split()) if N >= B: N = B - 1 ans = int(A * N / B) - A * int(N / B) print(ans)
[["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22]]
5
51
#include <iostream> using namespace std; typedef long long ll; int main() { ll a, b, n; cin >> a >> b >> n; ll x = (n % b) ? n : b - 1; cout << a * x / b << endl; }
#include <iostream> using namespace std; typedef long long ll; int main() { ll a, b, n; cin >> a >> b >> n; ll x = (n >= b) ? b - 1 : n; cout << a * x / b << endl; }
[["-", 49, 50, 51, 41, 15, 23, 0, 16, 17, 109], ["+", 49, 50, 51, 41, 15, 23, 0, 16, 17, 20], ["-", 8, 9, 0, 43, 49, 50, 51, 41, 64, 22], ["-", 8, 9, 0, 43, 49, 50, 51, 41, 0, 102], ["+", 8, 9, 0, 43, 49, 50, 51, 41, 0, 102], ["+", 8, 9, 0, 43, 49, 50, 51, 41, 75, 22]]
1
57
a, b, n = map(int, input().split()) if n <= b - 1: x = n else: x = b - (n%b + 1) ans = a*x//b - a*(x//b) print(ans)
a, b, n = map(int, input().split()) if n <= b - 1: x = n else: x = n - (n%b + 1) ans = a*x//b - a*(x//b) print(ans)
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22]]
5
60
a, b, n = map(int, input().split()) if n >= b: ans = a*(n - n%b - 1)//b - a*(n - n%b - 1)//b else: ans = a*n//b - a*(n//b) print(ans)
a, b, n = map(int, input().split()) if n >= b: ans = (a*(n - n%b - 1))//b - a*((n - n%b - 1)//b) else: ans = a*n//b - a*(n//b) print(ans)
[["+", 0, 662, 12, 657, 31, 657, 31, 23, 0, 24], ["+", 31, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["+", 0, 662, 12, 657, 12, 657, 12, 23, 0, 24], ["+", 0, 662, 12, 657, 12, 657, 12, 23, 0, 25]]
5
73
A, B, N = map(int, input().split()) print(min(B-1, N))
A, B, N = map(int, input().split()) print(A*min(B-1, N)//B)
[["+", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 48], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
29
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, c, n; cin >> a >> b >> c; n = min(b, c); cout << (long long)((a * n) / b); }
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, c, n; cin >> a >> b >> c; n = min(b - 1, c); cout << (long long)((a * n) / b); }
[["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
56
from math import floor def f(x): return floor(A*x/B)-A*floor(x/B) A, B, N = map(int, input().split()) print(f(min(N, B-B/A)))
from math import floor def f(x): return floor(A*x/B)-A*floor(x/B) A, B, N = map(int, input().split()) print(f(min(N, B-1)))
[["-", 0, 652, 3, 4, 0, 657, 12, 657, 31, 22], ["-", 0, 652, 3, 4, 0, 657, 12, 657, 17, 85], ["-", 0, 652, 3, 4, 0, 657, 12, 657, 12, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
62
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> // Acknowledgement: Special thanks to kyomukyomupurin, who developed this // template. template <class T, class U> std::ostream &operator<<(std::ostream &os, ...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> // Acknowledgement: Special thanks to kyomukyomupurin, who developed this // template. template <class T, class U> std::ostream &operator<<(std::ostream &os, ...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
512
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; vector<int> to[100005]; int main() { ll a, b, n; cin >> a >> b >> n; if (b >= n) cout << a * n / b << endl; else cout << a * (b - 1...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; vector<int> to[100005]; int main() { ll a, b, n; cin >> a >> b >> n; if (b > n) cout << a * n / b << endl; else cout << a * (b - 1)...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
100
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define size_of_array(array) (sizeof(array) / sizeof(array[0])) #define max 100005 using ll = long long; using namespace std; using Graph = vector<vector<int>>; int main() { ll a, b, n; cin >> a >> b >> n; ll x = n; if (n > b) { x = ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define size_of_array(array) (sizeof(array) / sizeof(array[0])) #define max 100005 using ll = long long; using namespace std; using Graph = vector<vector<int>>; int main() { ll a, b, n; cin >> a >> b >> n; ll x = n; if (n >= b - 1) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
108
a,b,n = list(map(int, input().split())) def f(x): return a*x//b - a*(x//b) left=1 right=n for _ in range(100): delta=(right-left)/3 midl=left+delta midr=midl+delta # print(f'left={left} midl={midl} midr={midr} right={right}') if f(midl)>f(midr): right=midr else: left=midl pri...
a,b,n = list(map(int, input().split())) def f(x): return a*x//b - a*(x//b) left=1 right=n for _ in range(100): delta=(right-left)/3 midl=left+delta midr=midl+delta # print(f'left={left} midl={midl} midr={midr} right={right}') if f(midl)>f(midr): right=midr else: left=midl pri...
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
122
#include <bits/stdc++.h> using namespace std; using lli = long long; using pii = pair<int, int>; #define rep(i, k, n) for (int i = (k); i != int(n); ++i) #define sz(x) x.size() #define all(x) x.begin(), x.end() #define dbg(x) cout << #x << '=' << x << '\n' #define dbg2(x, y) cout << #x << '=' << x << ' ' << #y << '='...
#include <bits/stdc++.h> using namespace std; using lli = long long; using pii = pair<int, int>; #define rep(i, k, n) for (int i = (k); i != int(n); ++i) #define sz(x) x.size() #define all(x) x.begin(), x.end() #define dbg(x) cout << #x << '=' << x << '\n' #define dbg2(x, y) cout << #x << '=' << x << ' ' << #y << '='...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
143
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; int main() { ll a, b, n, m; cin >> a >> b >> n; m = min(n, b); ll y = (a * m) / b; cout << y << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; int main() { ll a, b, n, m; cin >> a >> b >> n; m = min(n, b - 1); ll y = (a * m) / b; cout << y << endl; return 0; }
[["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
72
/* Jai Shree Krishna !! Radhe Radhe !! उद्यमेन हि सिद्ध्यन्ति कार्याणि न मनोरथैः। नहि सुप्तस्य सिंहस्य मुखे प्रविशन्ति मृगाः।। */ #include <bits/stdc++.h> using namespace std; #define int long long typedef long long ll; #define loop(i, ...
/* Jai Shree Krishna !! Radhe Radhe !! उद्यमेन हि सिद्ध्यन्ति कार्याणि न मनोरथैः। नहि सुप्तस्य सिंहस्य मुखे प्रविशन्ति मृगाः।। */ #include <bits/stdc++.h> using namespace std; #define int long long typedef long long ll; #define loop(i, ...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 19]]
1
255
A,B,N = map(int,input().split()) if B<N: print(int((A*(B-1))/B)-(A*int((B-1)/B))) else: print(int((A*N)/B)-(A*int(N/B)))
A,B,N = map(int,input().split()) if B<=N: print(int((A*(B-1))/B)-(A*int((B-1)/B))) else: print(int((A*N)/B)-(A*int(N/B)))
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
81
a,b,n=map(int,input().split()) x=n%b print(int(a*x/b)-a*int(x/b))
a,b,n=map(int,input().split()) #x=n%b x=min(n,b-1) print(int(a*x/b)-a*int(x/b))
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
43
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long int a, b, n, product; cin >> a >> b >> n; if (b <= n) { cout << (a * (b - 1)) / b; } else { cout << (a * (n - 1)) / b; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long int a, b, n, product; cin >> a >> b >> n; if (b <= n) { cout << (a * (b - 1)) / b; } else { cout << (a * n) / b; } return 0; }
[["-", 12, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33], ["-", 31, 23, 0, 16, 12, 23, 0, 16, 12, 13], ["-", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25]]
1
94
a,b,n=map(int,input().split()) r=min(n,b) print((a*r)//b)
a,b,n=map(int,input().split()) r=min(n,b-1) print((a*r)//b)
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
36
import math A,B,N = map(int,input().split()) siki = 0 k = math.floor(N/B) m = k*B if (B-1) <= N: siki = math.floor((A*(B-1))/B)-A*math.floor((B-1)/B) elif B>N: siki = math.floor((A*N)/B)-A*math.floor((N/B))
import math A,B,N = map(int,input().split()) siki = 0 k = math.floor(N/B) m = k*B if (B-1) <= N: siki = math.floor((A*(B-1))/B)-A*math.floor((B-1)/B) elif B>N: siki = math.floor((A*N)/B)-A*math.floor((N/B)) print(siki)
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
112
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll A, B, N; cin >> A >> B >> N; ll res; ll r_max; if (N > B) r_max = B - 1; else r_max = N; res = A * r_max / B; cout << res << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll A, B, N; cin >> A >> B >> N; ll res; ll r_max; if (N >= B - 1) r_max = B - 1; else r_max = N; res = A * r_max / B; cout << res << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
73
import math A,B,N = map(int, input().split()) c = 0 if B > N: c = (math.floor(A * N / B))-(A * (math.floor(N / B))) elif B < N: c = (math.floor(A * (B-1) / B))-(A * (math.floor((B - 1) / B))) print(c)
import math A,B,N = map(int, input().split()) c = 0 if B > N: c = (math.floor(A * N / B))-(A * (math.floor(N / B))) elif B <= N: c = (math.floor(A * (B-1) / B))-(A * (math.floor((B - 1) / B))) print(c)
[["-", 0, 656, 0, 57, 75, 665, 15, 666, 667, 18], ["+", 0, 656, 0, 57, 75, 665, 15, 666, 667, 19]]
5
103
function Main(input) { input = input.trim().split(" "); var A = parseInt(input[0], 10); var B = parseInt(input[1], 10); var N = parseInt(input[2], 10); var x = min(B - 1, N); var f = Math.floor((A * x) / B) - A * Math.floor(x / B); console.log(f); } Main(require("fs").readFileSync("/dev/stdin", "utf8"))...
function Main(input) { input = input.trim().split(" "); var A = parseInt(input[0], 10); var B = parseInt(input[1], 10); var N = parseInt(input[2], 10); var x = Math.min(B - 1, N); var f = Math.floor((A * x) / B) - A * Math.floor(x / B); console.log(f); } Main(require("fs").readFileSync("/dev/stdin", "ut...
[["+", 0, 198, 0, 200, 51, 2, 63, 558, 500, 22], ["+", 0, 198, 0, 200, 51, 2, 63, 558, 0, 131]]
2
128
A, B, N = map(int, input().split()) x = max(N, B-1) ans = (A*x)//B - A*(x//B) print(ans)
A, B, N = map(int, input().split()) x = min(N, B-1) ans = (A*x)//B - A*(x//B) print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
49
def solve(string): a, b, n = map(int, string.split()) return str(a * (b - 1) // b) if b < n else str(a * n // b) if __name__ == '__main__': import sys print(solve(sys.stdin.read().strip()))
def solve(string): a, b, n = map(int, string.split()) return str(a * (b - 1) // b) if b <= n else str(a * n // b) if __name__ == '__main__': import sys print(solve(sys.stdin.read().strip()))
[["-", 8, 196, 0, 37, 0, 41, 0, 666, 667, 18], ["+", 8, 196, 0, 37, 0, 41, 0, 666, 667, 19]]
5
74
A, B, N = [ int(i) for i in input().strip().split(' ')] max_floor = 0 if B >= N: max_floor = int(A * N / B) - A * int(N/B) print(max_floor) else: floor = int(A * (B-1) / B) - A * int((B-1)/B) if max_floor < floor: max_floor = floor print(max_floor)
A, B, N = [ int(i) for i in input().strip().split(' ')] max_floor = 0 if B > N: max_floor = int(A * N / B) - A * int(N/B) print(max_floor) else: floor = int(A * (B-1) / B) - A * int((B-1)/B) if max_floor < floor: max_floor = floor print(max_floor)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
101
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int64_t A, B, N; cin >> A >> B >> N; // int judge = 0; int64_t x = 0; int64_t l, m, y; // cout << "x = 9" << endl; // cout << "l = " << (A*x)/B << endl; // cout << "m = " << x/B << endl; if (N...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int64_t A, B, N; cin >> A >> B >> N; // int judge = 0; int64_t x = 0; int64_t l, m, y; // cout << "x = 9" << endl; // cout << "l = " << (A*x)/B << endl; // cout << "m = " << x/B << endl; if (N...
[["-", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22]]
1
123
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { ll a, b, n; cin >> a >> b >> n; ll ans; if (b >= n) { ans = (a * n) / b - a * (n / b); } else { ans = (a * (b - 1)) / b - a * ((b - 1) / b); } cout << ans << endl;...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { ll a, b, n; cin >> a >> b >> n; ll ans; if (b > n) { ans = (a * n) / b - a * (n / b); } else { ans = (a * (b - 1)) / b - a * ((b - 1) / b); } cout << ans << endl; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
105
import math a, b, n = map(int, input().split()) if n < b: x = n score = math.floor(a*x/b) - a * math.floor(x/b) print(score) else: x = b-1 score = math.floor(a*x/b) - a * math.floor(x/b) print(max_score)
import math a, b, n = map(int, input().split()) if n < b: x = n score = math.floor(a*x/b) - a * math.floor(x/b) print(score) else: x = b-1 score = math.floor(a*x/b) - a * math.floor(x/b) print(score)
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
89
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define debug(var) cerr << (#var) << " = " << (var) << endl; #else #define debug(var) #endif void init() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } void solve() { long long a, b, n; scanf("%lld%lld%lld", &a, &b, &n); if (n >= b) ...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define debug(var) cerr << (#var) << " = " << (var) << endl; #else #define debug(var) #endif void init() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } void solve() { long long a, b, n; scanf("%lld%lld%lld", &a, &b, &n); if (n >= b) ...
[["-", 64, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 64, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
145
a,b,n = map(int,input().split()) if n<b: answer = (a*n//b)-a*(n//b) else: answer = (a*(n-1)//b) - a*((n-1)//b) print(answer)
a,b,n = map(int,input().split()) if n<b: answer = (a*n//b)-a*(n//b) else: answer = (a*(b-1)//b) - a*((b-1)//b) print(answer)
[["-", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["-", 12, 23, 0, 657, 31, 23, 0, 657, 31, 22], ["+", 12, 23, 0, 657, 31, 23, 0, 657, 31, 22]]
5
71
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long int #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) int main() { ll a, b, n; cin >> a >> b >> n; if ((b - 1) > n) cout << (floor(a * (n / b))) - (a * floor(n / b)); else cout << (floor((a * (b - 1)) / b)) ...
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long int #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) int main() { ll a, b, n; cin >> a >> b >> n; if ((b - 1) > n) cout << (floor((a * n) / b)) - (a * floor(n / b)); else cout << (floor((a * (b - 1)) / b)) ...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["-", 0, 2, 3, 4, 0, 16, 12, 23, 0, 24], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["-", 0, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
1
117
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define MAX 1001000 #define MOD 1000000007 #define endl "\n" lli arr[MAX]; lli N; lli M; lli Q; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); lli t; t = 1; while (t--) { lli A, B, N; cin >> A >> B >> N; lli f ...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define MAX 1001000 #define MOD 1000000007 #define endl "\n" lli arr[MAX]; lli N; lli M; lli Q; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); lli t; t = 1; while (t--) { lli A, B, N; cin >> A >> B >> N; lli f ...
[["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 24], ["+", 49, 50, 51, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 31, 74, 0, 25]]
1
113
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (n); ++i) using namespace std; using ll = long long; long long gcd(long long a, long long b) { if (b == 0) return a; else return gcd(b, a % b); } int main() { ll a, b, n; cin >> a >> b >> n; cout << min(b - 1, n) << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (n); ++i) using namespace std; using ll = long long; long long gcd(long long a, long long b) { if (b == 0) return a; else return gcd(b, a % b); } int main() { ll a, b, n; cin >> a >> b >> n; cout << a * min(b - 1, n) / b << endl; }
[["+", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
88
// OPTIMIZATONS #pragma GCC optimize("02") // CODE #include <bits/stdc++.h> #define int long long #define float double #define endl "\n" #define debug cout << "Good uptill here" << endl << flush; #define deb(x) cout << #x << ":" << x << endl << flush; using namespace std; int32_t main() { ios_base::sync_with_stdio(...
// OPTIMIZATONS #pragma GCC optimize("02") // CODE #include <bits/stdc++.h> #define int long long #define float double #define endl "\n" #define debug cout << "Good uptill here" << endl << flush; #define deb(x) cout << #x << ":" << x << endl << flush; using namespace std; int32_t main() { ios_base::sync_with_stdio(...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
115
a,b,n = map(int,input().split()) print(min(n,b-1)/b*a)
a,b,n = map(int,input().split()) print(min(n,b-1)*a//b)
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 85], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
33
#include <iostream> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { ll a, b, c, n; cin >> a >> b >> c >> n; ll x = n; if (n >= b - 1) x = b - 1; ll ans = a * (x % b) / b; cout << ans << endl; return 0; }
#include <iostream> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { ll a, b, n; cin >> a >> b >> n; ll x = n; if (n >= b - 1) x = b - 1; ll ans = a * (x % b) / b; cout << ans << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 152], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
86
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n; cin >> a >> b >> n; if (n >= b) { cout << 1LL * (a * b - 1) / b << endl; } else { cout << 1LL * a * n / b << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n; cin >> a >> b >> n; if (n >= b) { cout << 1LL * a * (b - 1) / b << endl; } else { cout << 1LL * a * n / b << endl; } return 0; }
[["-", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24]]
1
70
import sys sys.setrecursionlimit(10 ** 6) # 再帰関数の再帰の深さを設定 to_index = lambda x: int(x) - 1 # 入力した数字に1を引いたものを返す print_list_in_2D = lambda x: print(*x, sep="\n") # リストの要素を改行を挟んで表示する関数 # 入力を整数に変換して受け取る def input_int(): return int(input()) def map_int_input(): return map(int, input()) MII = map_int_input def ...
import sys sys.setrecursionlimit(10 ** 6) # 再帰関数の再帰の深さを設定 to_index = lambda x: int(x) - 1 # 入力した数字に1を引いたものを返す print_list_in_2D = lambda x: print(*x, sep="\n") # リストの要素を改行を挟んで表示する関数 # 入力を整数に変換して受け取る def input_int(): return int(input()) def map_int_input(): return map(int, input()) MII = map_int_input def ...
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
260
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> PLL; typedef vector<int> VI; typedef vector<char> VC; typedef vector<double> VD; typedef vector<double> VL; typedef vector<string> VS; typedef vector<PLL> VP; typedef vector<ll> VLL; const static int INF = 1000000000; const static ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> PLL; typedef vector<int> VI; typedef vector<char> VC; typedef vector<double> VD; typedef vector<double> VL; typedef vector<string> VS; typedef vector<PLL> VP; typedef vector<ll> VLL; const static int INF = 1000000000; const static ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
383
#include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <random> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { double a, b, n, x, f1, f2; int ans; cin >> a >> b >> n; x = min(b - 1, n); ans = (a * x) / b - (x / b) * a; ...
#include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <random> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { long long a, b, n, x, f1, f2; int ans; cin >> a >> b >> n; x = min(b - 1, n); ans = (a * x) / b - (x / b) * ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
88
# D - Floor Function from math import floor A, B, N = map(int, input().split()) if B < N: mx = floor(A * (B - 1) / B) - A * floor((B - 1) / B) else: mx = floor(A * N / B) - A * floor(N / B) # mx = -1 * float('inf') # i = 0 # for i in range(N + 1): # result = floor(A * i / B) - A * floor(i / B) # pr...
# D - Floor Function from math import floor A, B, N = map(int, input().split()) if B <= N: mx = floor(A * (B - 1) / B) - A * floor((B - 1) / B) else: mx = floor(A * N / B) - A * floor(N / B) # mx = -1 * float('inf') # i = 0 # for i in range(N + 1): # result = floor(A * i / B) - A * floor(i / B) # p...
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
87
/*input 11 5 9 */ #include <bits/stdc++.h> #include <iostream> #include <math.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
/*input 11 5 9 */ #include <bits/stdc++.h> #include <iostream> #include <math.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
310
def q4(): import math A, B, N = (int(i) for i in input().split()) x = B - 1 if N > B else N ans = math.floor(x*A//B) - A * math.floor(x//B) return ans if __name__ == '__main__': ans = q4() print(ans)
def q4(): import math A, B, N = (int(i) for i in input().split()) x = B - 1 if N >= B else N ans = math.floor(x*A//B) - A * math.floor(x//B) return ans if __name__ == '__main__': ans = q4() print(ans)
[["-", 0, 1, 0, 662, 12, 41, 0, 666, 667, 47], ["+", 0, 1, 0, 662, 12, 41, 0, 666, 667, 20]]
5
81
import math a, b, n = map(int, input().split()) def f(x): return math.floor(a * x / b) - a * math.floor(x // b) print(f(min(b, n)))
import math a, b, n = map(int, input().split()) def f(x): return math.floor(a * x / b) - a * math.floor(x // b) print(f(min(b - 1, n)))
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
60
def f(x): return (A*x)//B-A*(x//B) A, B, N = map(int, input().split()) a = min(N, B) print(f(a))
def f(x): return (A*x)//B-A*(x//B) A, B, N = map(int, input().split()) a = min(N, B-1) print(f(a))
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
55
#include <stdio.h> int main() { long int x = 0; double A, B, N; scanf("%lf %lf %lf", &A, &B, &N); if (N > B) { x = A * ((B - 1) / B); printf("%ld", x); } else { x = A * (N / B); printf("%ld", x); } return 0; }
#include <stdio.h> int main() { long int x = 0; double A, B, N; scanf("%lf %lf %lf", &A, &B, &N); if (N >= B - 1) { x = A * ((B - 1) / B); printf("%ld", x); } else { x = A * (N / B); printf("%ld", x); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 12, 13]]
0
93
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i < (int)b; i++) #define rep(i, n) REP(i, 0, n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define watch(a) ...
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i < (int)b; i++) #define rep(i, n) REP(i, 0, n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define watch(a) ...
[["+", 0, 42, 0, 16, 31, 2, 3, 4, 0, 21], ["+", 0, 16, 31, 2, 3, 4, 0, 2, 63, 22], ["+", 31, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 31, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
322
from sys import stdin A,B,N=list(map(int, (stdin.readline().strip().split()))) if B-1<N:C=N else:C=N a=(A*C)//B b=A*(C//B) print(a-b)
from sys import stdin A,B,N=list(map(int, (stdin.readline().strip().split()))) if B-1<=N:C=B-1 else:C=N a=(A*C)//B b=A*(C//B) print(a-b)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
72
#include <iostream> using namespace std; int main() { long a, b, n, ans; cin >> a >> b >> n; if (n < b) ans = (a * n / b) - a * (n / b); else ans = (a * (b - 1)) / b - (a * (b - 1) / b); cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { long a, b, n, ans; cin >> a >> b >> n; if (n < b) ans = (a * n / b) - a * (n / b); else ans = (a * (b - 1) / b) - a * ((b - 1) / b); cout << ans << endl; return 0; }
[["-", 0, 11, 12, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["-", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 12, 16, 12, 23, 0, 24]]
1
89
a,b,c=map(int,input().split()) if c+1>=b: ans=int(a*(b-1)/b) else: ans=(a*c/b) print(ans)
a,b,c=map(int,input().split()) if c+1>=b: ans=int(a*(b-1)/b) else: ans=int(a*c/b) print(ans)
[["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
54
import sys import math a, b, n = map(int, input().split()) if (n < b): print(math.floor(a * n / b)) sys.exit() else: print(math.floor(a*(b+1)/b)-a*math.floor((b+1)/b))
import sys import math a, b, n = map(int, input().split()) if (n < b): print(math.floor(a * n / b)) sys.exit() else: print(math.floor(a*(2*b-1)/b)-a*math.floor((2*b-1)/b))
[["+", 31, 657, 12, 23, 0, 657, 31, 657, 31, 612], ["+", 31, 657, 12, 23, 0, 657, 31, 657, 17, 48], ["-", 0, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 31, 612], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 17, 48], ["-", 3, 4, 0, 657, 31, 23,...
5
81
A, B, N = [int(v) for v in input().strip().spilt(" ")] if N < B: print(int(A * N * B) - A * int(N / B)) else: print(int(A * (B - 1) * B) - A * int((B - 1) / B))
A, B, N = [eval(v) for v in input().strip().split(" ")] if N < B: print(int(A * N / B) - A * int(N / B)) else: print(int(A * (B - 1) / B) - A * int((B - 1) / B))
[["-", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["-", 12, 658, 0, 659, 12, 652, 63, 319, 319, 22], ["+", 12, 658, 0, 659, 12, 652, 63, 319, 319, 22], ["-", 0, 657, 31, 652, 3, 4, 0, 657, 17, 48], ["+", 0, 657, 31, 652, 3, 4, 0, 657, 17, 85]]
5
84
#include <bits/stdc++.h> // Begin Header {{{ #define all(x) (x).begin(), (x).end() #define lli long long int #define rep(i, n) for (lli i = 0; i < n; i++) #define loop(i, j, n) for (lli i = j; i < n; i++) #define Max(a, b) ((a) > (b) ? (a) : (b)) #define Min(a, b) ((a) < (b) ? (a) : (b)) constexpr int INF = 0x3f3f3f3f;...
#include <bits/stdc++.h> // Begin Header {{{ #define all(x) (x).begin(), (x).end() #define lli long long int #define rep(i, n) for (lli i = 0; i < n; i++) #define loop(i, j, n) for (lli i = j; i < n; i++) #define Max(a, b) ((a) > (b) ? (a) : (b)) #define Min(a, b) ((a) < (b) ? (a) : (b)) constexpr int INF = 0x3f3f3f3f;...
[["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
229
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 1000000007 c...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 1000000007 c...
[["-", 31, 2, 3, 4, 0, 16, 31, 16, 17, 85], ["-", 31, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 17, 85], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 12, 22]]
1
262
A, B, N = [int(x) for x in input().split()] def func(A, B, x): return int(A * x/ B) - A * int(x/B) if B < N: print(func(A, B, B - 1)) else: print(func(A, B, N))
A, B, N = [int(x) for x in input().split()] def func(A, B, x): return int(A * x / B) - A * int(x/B) if B <= N: print(func(A, B, B - 1)) else: print(func(A, B, N))
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
81
A, B, N = map(int, input().split()) def floor(x): out = (A * x)//B - A * (x//B) return out max = 0 #for i in range(N//2, N + 1): #if(floor(i) > max): #max = floor(i) if(floor(N) >= floor(B-1)): max = floor(N) else: max = floor(B-1) print(max)
A, B, N = map(int, input().split()) def floor(x): out = (A * x)//B - A * (x//B) return out max = 0 #for i in range(N//2, N + 1): #if(floor(i) > max): #max = floor(i) if(N < (B-1)): max = floor(N) else: max = floor(B-1) print(max)
[["-", 0, 57, 15, 23, 0, 666, 0, 652, 63, 22], ["-", 15, 23, 0, 666, 0, 652, 3, 4, 0, 24], ["-", 15, 23, 0, 666, 0, 652, 3, 4, 0, 25], ["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 18]]
5
84
#ABC165d import math a, b, n = map(int,input().split()) x = min(b-1,n) print(x) print(math.floor(a*x/b))
#ABC165d import math a, b, n = map(int,input().split()) x = min(b-1,n) print(math.floor(a*x/b))
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]]
5
48
import math a,b,n = map(int, input().split()) x = min(b,n) print(math.floor(a*x/b))
import math a,b,n = map(int, input().split()) x = min(b-1,n) print(math.floor(a*x/b))
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
41
#include <bits/stdc++.h> #define ll long long #define pb push_back #define eb emplace_back //#define st first #define sc second using namespace std; const ll mod = 1e9 + 7; const int e = 55; const int base = 311; // dung inverse module de tinh nCk // beginer 82 // mbeginer // cach tao hoan vi tu n so : n*(n+1)/2; ...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define eb emplace_back //#define st first #define sc second using namespace std; const ll mod = 1e9 + 7; const int e = 55; const int base = 311; // dung inverse module de tinh nCk // beginer 82 // mbeginer // cach tao hoan vi tu n so : n*(n+1)/2; ...
[["+", 0, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
110
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define mp make_pair using namespace std; typedef long long int ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, n, temp, ans1, ans2; cin >> a >> b >> n; if (n >= b) temp = b - 1; ans1 = (a * temp) ...
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define mp make_pair using namespace std; typedef long long int ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, n, temp, ans1, ans2; cin >> a >> b >> n; if (n >= b) n = b - 1; cout << (a * n) / b; ...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 12, 16, 31, ...
1
87
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll k, a, b, x, i, j, z, n; cin >> a >> b >> x; if (x > b) { x = b - 1; ; } cout << (a * x) / b - a * (x / b) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll k, a, b, x, i, j, z, n; cin >> a >> b >> x; if (x >= b) { x = b - 1; } cout << (a * x) / b - a * (x / b) << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
80
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < n; ++i) int main() { ll A, B, N, ans = 0; cin >> A >> B >> N; if (N < B) { ans = A * (N % B) - ((A * N) % B); ans = ans / B; } else { ans = A * (B - 1) % B - (A * (B - 1)) % B; ans = ans ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < n; ++i) int main() { ll A, B, N, ans = 0; cin >> A >> B >> N; if (N < B) { ans = A * (N % B) - ((A * N) % B); ans = ans / B; } else { ans = A * ((B - 1) % B) - (A * (B - 1)) % B; ans = an...
[["+", 31, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 25]]
1
121
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll A, B, N; cin >> A >> B >> N; if (B >= N) { cout << (ll)(A * N / B) - A * (ll)(N / B) << endl; return 0; } cout << (ll)(A * (B - 1) / B) - A * (ll)((B - 1) / B) << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll A, B, N; cin >> A >> B >> N; if (B - 1 >= N) { cout << (ll)(A * N / B) - A * (ll)(N / B) << endl; return 0; } cout << (ll)(A * (B - 1) / B) - A * (ll)((B - 1) / B) << endl; }
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
103
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include ...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include ...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 17, 109], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 22]]
1
681
a, b, n = map(int, input().split()) def f(x): return (a * x) // b - a * (x // b) if n < b: print(f(n)) else: print(f(b))
a, b, n = map(int, input().split()) def f(x): return (a * x) // b - a * (x // b) if n < b: print(f(n)) else: print(f(b - 1))
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
61
a, b, n = map(int, input().split()) print(a * (b-1) // b)
a, b, n = map(int, input().split()) print(a * min((b-1), n) // b)
[["+", 3, 4, 0, 657, 31, 657, 12, 652, 63, 22], ["+", 0, 657, 31, 657, 12, 652, 3, 4, 0, 24], ["+", 31, 657, 12, 652, 3, 4, 0, 23, 0, 25], ["+", 0, 657, 31, 657, 12, 652, 3, 4, 0, 21], ["+", 0, 657, 31, 657, 12, 652, 3, 4, 0, 22]]
5
30
func = [] A , B , N = map(int , input().split()) """ for x in range(N+1): func.append((A*x) // B - A * (x // B )) print(max(func)) """ if B - 1 > N + 1: print((A*(N)) // B - A * ((N) // B )) else: print((A*(B-1)) // B - A * ((B-1) // B ))
func = [] A , B , N = map(int , input().split()) """ for x in range(N+1): func.append((A*x) // B - A * (x // B )) print(max(func)) """ if B - 1 > N: print((A*(N)) // B - A * ((N) // B )) else: print((A*(B-1)) // B - A * ((B-1) // B ))
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
84
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; i++) #define repr(i, n) for (ll i = n; i >= 0; i--) #define reprr(i, m, n) for (ll i = m; i < n; i++) #define INF 2e15 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; int main...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; i++) #define repr(i, n) for (ll i = n; i >= 0; i--) #define reprr(i, m, n) for (ll i = m; i < n; i++) #define INF 2e15 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; int main...
[["+", 75, 76, 0, 9, 0, 1, 0, 27, 28, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
153
#include <bits/stdc++.h> #define ll long long int #define pii pair<int, int> #define F first #define S second #define mod 1000000007 /// cout <<"Case #"<<it<<": "; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, n; cin >> a >> b >> n; ll x = max(b - 1, n); ll an...
#include <bits/stdc++.h> #define ll long long int #define pii pair<int, int> #define F first #define S second #define mod 1000000007 /// cout <<"Case #"<<it<<": "; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, n; cin >> a >> b >> n; ll x = min(b - 1, n); ll an...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
99
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n, x, y; cin >> a >> b >> n; x = n / b * b - 1; y = x; if (x < 0) { x = 0; y = n; } cout << (a * y) / b - a * x << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, n, x, y; cin >> a >> b >> n; x = n / b * b - 1; y = x; if (x < 0) { x = 0; y = n; } cout << (a * y) / b - a * (x / b) << endl; }
[["+", 31, 16, 12, 16, 12, 16, 12, 23, 0, 24], ["+", 12, 16, 12, 16, 12, 23, 0, 16, 17, 85], ["+", 12, 16, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 31, 16, 12, 16, 12, 16, 12, 23, 0, 25]]
1
78
import math a, b, n = map(int, input().split()) y = b-1 x = 0 if x < n: x = y else: x = n print(math.floor(a*x/b))
import math a, b, n = map(int, input().split()) y = b-1 x = 0 if y < n: x = y else: x = n print(math.floor(a*x/b))
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
54
#include <bits/stdc++.h> using namespace std; #define ll long long #define dl double long #define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); ++i) #define rrep(i, m, n) for (ll i = (ll)(m); i > (ll)(n); --i) const ll MOD = 1000000007; const double pi = 3.14159265358979323846; int main(void) { ll a, b, n, x; cin...
#include <bits/stdc++.h> using namespace std; #define ll long long #define dl double long #define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); ++i) #define rrep(i, m, n) for (ll i = (ll)(m); i > (ll)(n); --i) const ll MOD = 1000000007; const double pi = 3.14159265358979323846; int main(void) { ll a, b, n, x; cin...
[["-", 75, 76, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 31, 22]]
1
108
#include <bits/stdc++.h> using namespace std; #define pb push_back #define rb pop_back #define rf pop_front #define ins insert #define f first #define s second #define um unordered_map #define us unordered_set #define pq priority_queue typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define rb pop_back #define rf pop_front #define ins insert #define f first #define s second #define um unordered_map #define us unordered_set #define pq priority_queue typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
518
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, x, n) for (int i = x; i < (n); i++) #define ALL(n) begin(n), end(n) #define MOD 1000000007 typedef long long ll; typedef unsigned int ui; typedef unsigned long long ull; template <class T> void print(T &x) { pr...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, x, n) for (int i = x; i < (n); i++) #define ALL(n) begin(n), end(n) #define MOD 1000000007 typedef long long ll; typedef unsigned int ui; typedef unsigned long long ull; template <class T> void print(T &x) { pr...
[["-", 0, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 31, 22]]
1
177
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; using ll = long long int; using dd = long double; const ll MOD = 1e9 + 7; const dd PI = 3.1415926535; class UnionFind { std::vector<int>...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; using ll = long long int; using dd = long double; const ll MOD = 1e9 + 7; const dd PI = 3.1415926535; class UnionFind { std::vector<int>...
[["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 85], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 22]]
1
345
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a = sc.nextDouble(); double b = sc.nextDouble(); double n = sc.nextDouble(); double count = b; if (n < b) { count = n; } System.out.println( ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a = sc.nextDouble(); double b = sc.nextDouble(); double n = sc.nextDouble(); double count = b - 1; if (n < b - 1) { count = n; } System.out.println...
[["+", 8, 196, 0, 503, 49, 200, 51, 16, 17, 33], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 12, 499], ["+", 0, 57, 15, 15, 0, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 15, 0, 16, 12, 16, 12, 499]]
3
115
A, B, N = gets.split.map(&:to_i) if N > B - 1 puts A * (B - 1 % B) / B else puts A * (N % B) / B end
A, B, N = gets.split.map(&:to_i) if N > B - 1 puts A * ((B - 1) % B) / B else puts A * (N % B) / B end
[["+", 31, 738, 12, 739, 0, 738, 31, 739, 0, 24], ["+", 31, 738, 12, 739, 0, 738, 31, 739, 0, 25]]
4
45
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pii> vii; #define F first #define S second #define sz(x) (int)x.size() #define db(x) cerr << #x << ": " << x << "\n"; int main() { ios::sync_with_stdio(false); cin.tie(0); ll A...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pii> vii; #define F first #define S second #define sz(x) (int)x.size() #define db(x) cerr << #x << ": " << x << "\n"; int main() { ios::sync_with_stdio(false); cin.tie(0); ll A...
[["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
121
from sys import setrecursionlimit, exit setrecursionlimit(1000000000) def main(): a, b, n = map(int, input().split()) print(a * min(n, b - 1) // b - a * (max(n, b - 1) // b)) main()
from sys import setrecursionlimit, exit setrecursionlimit(1000000000) def main(): a, b, n = map(int, input().split()) print(a * min(n, b - 1) // b - a * (min(n, b - 1) // b)) main()
[["-", 12, 657, 12, 23, 0, 657, 31, 652, 63, 22], ["+", 12, 657, 12, 23, 0, 657, 31, 652, 63, 22]]
5
66
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll A, B, N; cin >> A >> B >> N; if (B >= N) { cout << (A * N) / B - A * (N / B) << endl; } else { cout << (A * (B - 1)) / B - A * ((B - 1) / B) << endl; } }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll A, B, N; cin >> A >> B >> N; if (B > N) { cout << (A * N) / B - A * (N / B) << endl; } else { cout << (A * (B - 1)) / B - A * ((B - 1) / B) << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
91
#include <bits/stdc++.h> using namespace std; using lint = long long; int main(void) { lint A, B, N; cin >> A >> B >> N; lint x = B - 1; if (N < x) { x = N - 1; } cout << A * x / B - A * (x / B) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using lint = long long; int main(void) { lint A, B, N; cin >> A >> B >> N; lint x = B - 1; if (N < x) { x = N; } cout << A * x / B - A * (x / B) << endl; return 0; }
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
76
#!/usr/bin/env python3 import sys def solve(A: int, B: int, N: int): if B >= N: x = N else: x = B - 1 print(A * x // B) return # Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom...
#!/usr/bin/env python3 import sys def solve(A: int, B: int, N: int): if B > N: x = N else: x = B - 1 print(A * x // B) return # Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom ...
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47]]
5
125
N = [int(e) for e in input().split()] t = N[1] - 1 if(t > N[2]): t = N[2] ans = (N[0]*N[2])//N[1] - N[0]*(t//N[1]) print(ans)
N = [int(e) for e in input().split()] t = N[1] - 1 if(t > N[2]): t = N[2] ans = (N[0]*t)//N[1] - N[0]*(t//N[1]) print(ans)
[["-", 31, 657, 31, 23, 0, 657, 12, 206, 51, 22], ["-", 31, 657, 31, 23, 0, 657, 12, 206, 0, 70], ["-", 31, 657, 31, 23, 0, 657, 12, 206, 206, 612], ["-", 31, 657, 31, 23, 0, 657, 12, 206, 0, 73], ["+", 12, 657, 31, 657, 31, 23, 0, 657, 12, 22]]
5
78
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { int a; ll b, n; cin >> a >> b >> n; ll x = max(n, b - 1); cout << (a * x) / b - a * (x / b) << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { int a; ll b, n; cin >> a >> b >> n; ll x = min(n, b - 1); cout << (a * x) / b - a * (x / b) << endl; }
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
74
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vr vector #define pb push_back #define mod 1000000007 #define all(v) v.begin(), v.end() ll pow(ll x, ll n, ll p, ll res) { if (n == 0) return res % p; if (n & 1) { res = ((res % p) * (x % p)) % p; n--; } x = ((x % p) * (...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define vr vector #define pb push_back #define mod 1000000007 #define all(v) v.begin(), v.end() ll pow(ll x, ll n, ll p, ll res) { if (n == 0) return res % p; if (n & 1) { res = ((res % p) * (x % p)) % p; n--; } x = ((x % p) * (...
[["-", 0, 9, 0, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 31, 22]]
1
222