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 |
|---|---|---|---|---|
/* god is with you dont worry */
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define input() \
ios_base::sync_with_stdio(false); \
cin.tie(0);
co... | /* god is with you dont worry */
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define input() \
ios_base::sync_with_stdio(false); \
cin.tie(0);
co... | [["-", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22]] | 1 | 119 |
a, b, n = map(int, input().split())
def floor(x):
return int(a * x / b) - a * int(x / b)
if n >= b-1:
ans = floor(b-1)
else:
ans = floor(n-1)
print(ans)
| a, b, n = map(int, input().split())
def floor(x):
return int(a * x / b) - a * int(x / b)
if n >= b-1:
ans = floor(b-1)
else:
ans = floor(n)
print(ans)
| [["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 71 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
typedef unsigned long long int ull;
typedef long double ldb;
#define B 1000000007
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define repi(i, a, b) for (ll i = b - 1; i >= a; i--)
#define MT make_tuple
#define G(a, b) get<a>(b)
#define VI vector... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
typedef unsigned long long int ull;
typedef long double ldb;
#define B 1000000007
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define repi(i, a, b) for (ll i = b - 1; i >= a; i--)
#define MT make_tuple
#define G(a, b) get<a>(b)
#define VI vector... | [["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 78]] | 1 | 632 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b, n, x;
cin >> a >> b >> n;
x = min(n - 1, b);
cout << a * (x % b) / b << endl;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b, n, x;
cin >> a >> b >> n;
x = min(n, b - 1);
cout << a * (x % b) / b << endl;
} | [["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 65 |
a, b, n = map(int,input().split())
if n-1 >= b:
x = n-1
else:
x = n
print(a*x//b - a*(x//b)) | a, b, n = map(int,input().split())
if n >= b-1:
x = b-1
else:
x = n
print(a*x//b - a*(x//b)) | [["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22]] | 5 | 51 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i, a, n) for (int i = a; i < (int)n; i++)
#define rf(i, n, a) for (int i = n; i >= a; i--)
#define F first
#define S second
#define all(c) (c).begin(), (c).end()
#define sz(v) (i... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i, a, n) for (int i = a; i < (int)n; i++)
#define rf(i, n, a) for (int i = n; i >= a; i--)
#define F first
#define S second
#define all(c) (c).begin(), (c).end()
#define sz(v) (i... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 16, 12, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 16, 31, 23, 0, 25]] | 1 | 161 |
#!/usr/bin/python3
import math
#標準出力からの読み込み
input_1 = input()
a = int(input_1.split(" ")[0])
b = int(input_1.split(" ")[1])
n = int(input_1.split(" ")[2])
#判定ロジック
score = math.floor(a/b*math.min(b-1, n))
print(score) | #!/usr/bin/python3
import math
#標準出力からの読み込み
input_1 = input()
a = int(input_1.split(" ")[0])
b = int(input_1.split(" ")[1])
n = int(input_1.split(" ")[2])
#判定ロジック
score = math.floor(a/b*min(b-1, n))
print(score) | [["-", 3, 4, 0, 657, 12, 652, 63, 319, 500, 22], ["-", 3, 4, 0, 657, 12, 652, 63, 319, 0, 131]] | 5 | 83 |
A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)//b - A*(x//b))
| A,B,N = map(int,input().split())
x = min(B-1,N)
print((A*x)//B-A*(x//B))
| [["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 0, 657, 12, 657, 12, 23, 0, 657, 12, 22], ["+", 0, 657, 12, 657, 12, 23, 0, 657, 12, 22]] | 5 | 46 |
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
public class Main {
public static void main(String[] args) { exe... | import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
public class Main {
public static void main(String[] args) { exe... | [["-", 12, 16, 12, 492, 3, 4, 0, 16, 31, 22], ["+", 12, 16, 12, 492, 3, 4, 0, 16, 31, 22]] | 3 | 320 |
#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <chrono>
#include <climits>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
using name... | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <chrono>
#include <climits>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
using name... | [["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 196 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x).rend()
#define limit(... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = (0); i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x).rend()
#define limit(... | [["+", 0, 1, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 16, 12, 23, 0, 25], ["-", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 109], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["-", 31, 16, 12, 16, 31, 16, 12, 23, 0, 25]] | 1 | 719 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll x;
if (b == 1) {
cout << 2 * a * n;
return 0;
}
if (n >= b)
x = b - 1;
else
x = n;
cout << a * x / b;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll x;
if (b == 1) {
cout << 0;
return 0;
}
if (n >= b)
x = b - 1;
else
x = n;
cout << a * x / b;
} | [["-", 0, 1, 0, 16, 12, 16, 31, 16, 31, 13], ["-", 0, 1, 0, 16, 12, 16, 31, 16, 17, 48], ["-", 0, 1, 0, 16, 12, 16, 31, 16, 12, 22], ["-", 64, 9, 0, 1, 0, 16, 12, 16, 17, 48], ["-", 64, 9, 0, 1, 0, 16, 12, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13]] | 1 | 79 |
#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>;
int debug = 1;
int main() {
ll a, b, n, x;
ll ans;
cin >> a >> b >> n;
if (b == 1) {
ans = 0;
} else if (a == 1) {
ans = 0;
} else {
if (n <= b) {
... | #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>;
int debug = 1;
int main() {
ll a, b, n, x;
ll ans;
cin >> a >> b >> n;
if (b == 1) {
ans = 0;
} else if (a == 1) {
ans = 0;
} else {
if (n < b - 1) {
... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]] | 1 | 159 |
#include <bits/stdc++.h>
using namespace std;
#define 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 - A * (x % B);
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define 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 - A * (x / B);
cout << ans << endl;
}
| [["-", 0, 43, 49, 50, 51, 16, 31, 16, 17, 109], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 85], ["-", 51, 16, 12, 16, 12, 23, 0, 16, 17, 109], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 17, 85]] | 1 | 74 |
#include <stdio.h>
int main() {
long long a, b, n, ans;
scanf("%d%d%d", &a, &b, &n);
if (n >= b) {
ans = (a * (b - 1) - (a * (b - 1)) % b) / b;
} else {
ans = (a * n - (a * n) % b) / b;
}
printf("%lld", ans);
return 0;
}
| #include <stdio.h>
int main() {
long long a, b, n, ans;
scanf("%lld%lld%lld", &a, &b, &n);
if (n >= b) {
ans = (a * (b - 1) - (a * (b - 1)) % b) / b;
} else {
ans = (a * n - (a * n) % b) / b;
}
printf("%lld", ans);
return 0;
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 101 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (n <= b)
cout << (a * n) / b << "\n";
else
cout << (a * (b - 1)) / b << "\n";
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (n < b)
cout << (a * n) / b << "\n";
else
cout << (a * (b - 1)) / b << "\n";
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 78 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef vector<ll> vcl;
#define mod 1000000007
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll z = max(n, b - 1);
ll ans = a * z / b - a * (z / b);
cout << ans << endl... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef vector<ll> vcl;
#define mod 1000000007
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll z = min(n, b - 1);
ll ans = a * z / b - a * (z / b);
cout << ans << endl... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 99 |
arr = input().split(" ")
a, b, n = int(arr[0]), int(arr[1]), int(arr[2])
if b<=n:
k = int((a*(b-1))/b)
else:
k = int((a*n)/b)
| arr = input().split(" ")
a, b, n = int(arr[0]), int(arr[1]), int(arr[2])
if b<=n:
k = int((a*(b-1))/b)
else:
k = int((a*n)/b)
print(k) | [["+", 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 | 76 |
def resolve():
A, B, N = map(int, input().split())
print(A * min(N, B) // B)
resolve() | def resolve():
A, B, N = map(int, input().split())
print(A * min(N, B - 1) // B)
resolve() | [["+", 31, 657, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 31, 657, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 39 |
#define rep(i, n) for (ll i = 0; i < n; i++)
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans;
if (n >= b)
ans = a - 1;
else
ans = a * n / b;
cout << ans << endl;
return 0;
}
| #define rep(i, n) for (ll i = 0; i < n; i++)
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll ans;
if (n >= b)
ans = a * (b - 1) / b;
else
ans = a * n / b;
cout << ans << endl;
return 0;
}
| [["+", 64, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 25], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 85], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]] | 1 | 86 |
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
int main(int argc, const char *argv[]) {
// fasten cin
cin.tie(0);
ios::sync_with_stdio(false);
// implement
int64_t a, b, n;
... |
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
int main(int argc, const char *argv[]) {
// fasten cin
cin.tie(0);
ios::sync_with_stdio(false);
// implement
int64_t a, b, n;
... | [["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 100 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
long long int x = 0;
long long int tmpx = n % b;
if (n < b - 1) {
x = n;
} else {
x = (n / b) * b - 1;
}
long long int tmp... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
long long int x = 0;
long long int tmpx = n % b;
if (n <= b - 1) {
x = n;
} else {
x = (n / b) * b - 1;
}
long long int tm... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 126 |
import math
A, B, N = map(int, input().split())
if N > B:
N = B
ans = math.floor(A * N / B)
print(ans) | import math
A, B, N = map(int, input().split())
if N >= B:
N = B - 1
ans = math.floor(A * N / B)
print(ans) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 44 |
#include <bits/stdc++.h>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int a, b, n;
cin >> a >> b >> n;
if (b < n)
cout << (a * (b - 1)) / b - a * ((b - 1) / b) << endl;
else
cout << (a * n) / b - a *... | #include <bits/stdc++.h>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (b <= n)
cout << (a * (b - 1)) / b - a * ((b - 1) / b) << endl;
else
cout << (a * n) / b - a *... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 111 |
import math
A, B, N = list(map(int, input().split()))
minx = min([B-1, N])
print(math.floor(A*minx/B) - A*math.floor(minx*B)) | import math
A, B, N = list(map(int, input().split()))
minx = min([B-1, N])
print(math.floor(A*minx/B) - A*math.floor(minx/B)) | [["-", 12, 657, 12, 652, 3, 4, 0, 657, 17, 48], ["+", 12, 657, 12, 652, 3, 4, 0, 657, 17, 85]] | 5 | 59 |
import math
A,B,N=map(int,input().split())
print(math.floor(A/B*(~-B if N>B else N)))
| import math
A,B,N=map(int,input().split())
print(math.floor(A/B*(~-B if N>=B else N)))
| [["-", 0, 657, 12, 23, 0, 41, 0, 666, 667, 47], ["+", 0, 657, 12, 23, 0, 41, 0, 666, 667, 20]] | 5 | 43 |
a, b, n = [int(x) for x in input().split()]
x = min(b - 1, n)
answer = floor(a * x / b) - a * floor(x / b)
print(answer) | from math import floor
a, b, n = [int(x) for x in input().split()]
x = min(b - 1, n)
answer = floor(a * x / b) - a * floor(x / b)
print(answer) | [["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22]] | 5 | 55 |
a, b, n = map(int, input().split())
def calc(x):
return int(a*x/b)-a*int(x/b)
print(calc(min(b,n))) | a, b, n = map(int, input().split())
def calc(x):
return int(a*x/b)-a*int(x/b)
print(calc(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 | 54 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
const ll INF... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
const ll INF... | [["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 31, 22], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]] | 1 | 181 |
#include <bits/stdc++.h>
using namespace std;
int main() {
// sengen
long long a, b, n;
// nyuryoku
cin >> a >> b >> n;
// keisan
if (n < b) {
cout << (long long)floorl((long long)a / b * n);
} else {
cout << (long long)floorl((long long)a / b * (b - 1));
}
// syutsuryoku
} | #include <bits/stdc++.h>
using namespace std;
int main() {
// sengen
long long a, b, n;
// nyuryoku
cin >> a >> b >> n;
// keisan
if (n < b) {
cout << (long long)floorl((double)a / b * n);
} else {
cout << (long long)floorl((double)a / b * (b - 1));
}
// syutsuryoku
} | [["-", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 0, 16, 31, 16, 31, 74, 39, 77, 39, 40]] | 1 | 85 |
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
long long a, b, n;
long long c, d;
int main() {
// freopen("in.txt","r",stdin);
// freopen("out1.txt","w",stdout);
cin >> a >> b >> n;
if (n > b) {
n = b - 1;
}
c = floor(a * n / b);
d = a * floor(n / b);
cout << c - d;
//... | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
long long a, b, n;
long long c, d;
int main() {
// freopen("in.txt","r",stdin);
// freopen("out1.txt","w",stdout);
cin >> a >> b >> n;
if (n >= b) {
n = b - 1;
}
c = floor(a * n / b);
d = a * floor(n / b);
cout << c - d;
/... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 84 |
import math
A, B, N = map(int, input().split())
x = min(N-1, B)
print(math.floor(A*x/B) - A*math.floor(x/B)) | import math
A, B, N = map(int, input().split())
x = min(N, B-1)
print(math.floor(A*x/B) - A*math.floor(x/B)) | [["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 54 |
a,b,n = map(int, input().split(" "))
def floor(x):
return ((a*x/b)//1) - a*((x/b)//1)
ans = floor(max(b-1,n))
print(int(ans)) | a,b,n = map(int, input().split(" "))
def floor(x):
return ((a*x/b)//1) - a*((x/b)//1)
ans = floor(min(b-1,n))
print(int(ans)) | [["-", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22]] | 5 | 71 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;
int gcd(int a, int b) {
if (b =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;
int gcd(int a, int b) {
if (b =... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["-", 0, 16, 12, 16, 31, 16, 12, 23, 0, 25]] | 1 | 162 |
a,b,n = map(int, input().split())
def f(x):
return (a*(x%b)-(a*b)%b)//b
ans = f(min(n,b-1)) | a,b,n = map(int, input().split())
def f(x):
return (a*(x%b)-(a*b)%b)//b
ans = f(min(n,b-1))
print(ans) | [["+", 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 | 57 |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define IO \
ios::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define IO \
ios::sync_with_stdio(false); \
cin.tie(0); ... | [["-", 31, 16, 12, 2, 3, 4, 0, 2, 63, 22], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 25]] | 1 | 131 |
A,B,N = gets.split.map &:to_i
n = N%B > 0 ? N-1-N%B : N
p (n%B*A - A*n%B) / B | A,B,N = gets.split.map &:to_i
n = N>=B ? N-1-N%B : N
p (n%B*A - A*n%B) / B | [["-", 0, 662, 12, 754, 15, 738, 31, 738, 17, 109], ["+", 0, 493, 0, 662, 12, 754, 15, 738, 17, 20], ["-", 0, 493, 0, 662, 12, 754, 15, 738, 17, 47], ["-", 0, 493, 0, 662, 12, 754, 15, 738, 12, 612]] | 4 | 46 |
A,B,N = gets.split.map &:to_i
n = N%B > 0 ? N-1-N%B : N
p (n%B*A - A*n%B) / B | A,B,N = gets.split.map &:to_i
n = N/B*B > 0 ? N-1-N%B : N
p (n%B*A - A*n%B) / B | [["-", 0, 662, 12, 754, 15, 738, 31, 738, 17, 109], ["+", 12, 754, 15, 738, 31, 738, 31, 738, 17, 85], ["+", 12, 754, 15, 738, 31, 738, 31, 738, 12, 743], ["+", 0, 662, 12, 754, 15, 738, 31, 738, 17, 48]] | 4 | 46 |
#include <bits/stdc++.h>
using namespace std;
void solve(long long A, long long B, long long N) {
long long x = N <= B ? N : B - 1;
long long ans = floor((A * (x % B)) / B);
cout << ans << endl;
}
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You
// use the default template now. Y... | #include <bits/stdc++.h>
using namespace std;
void solve(long long A, long long B, long long N) {
long long x = N < B ? N : B - 1;
long long ans = floor((A * (x % B)) / B);
cout << ans << endl;
}
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You
// use the default template now. Yo... | [["-", 0, 43, 49, 50, 51, 41, 15, 16, 17, 19], ["+", 0, 43, 49, 50, 51, 41, 15, 16, 17, 18]] | 1 | 125 |
import math
A,B,N= map(int,input().split())
if B<N:
lista=(math.floor((A*(B-1))/B)-A*(math.floor((B-1)/B)))
print(lista)
else:
list=(math.floor((A*N)/B)-A*(math.floor(N/B)))
print(list)
| import math
A,B,N= map(int,input().split())
if B<=N:
lista=(math.floor((A*(B-1))/B)-A*(math.floor((B-1)/B)))
print(lista)
else:
list=(math.floor((A*N)/B)-A*(math.floor(N/B)))
print(list)
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]] | 5 | 101 |
#D
A,B,N=map(int,input().split())
if N>=B:
ans=A-int(A/B)
else:
ans=int(A*N/B)
print(ans) | #D
A,B,N=map(int,input().split())
if N>=B:
ans=int(A-A/B)
else:
ans=int(A*N/B)
print(ans) | [["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33]] | 5 | 50 |
import math
a,b,n=map(int, input().split())
m = 0
c = 0
if n<b:
m = math.floor(a*n/b)
else:
c = math.floor(a*(b-1)/b)-a*math.floor((b-1)/b)
print(m) | import math
a,b,n=map(int, input().split())
m = 0
if n<b:
m = math.floor(a*n/b)
else:
m = math.floor(a*(b-1)/b)-a*math.floor((b-1)/b)
print(m) | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22]] | 5 | 80 |
A,B,N=map(int,input().split())
x=B-1
def f(t):
return int(t//1)
if N>B:
M=f(A*x/B)-A*f(x/B)
print (M)
else:
N=f(A*N/B)-A*f(N/B)
print (N) | A,B,N=map(int,input().split())
x=B-1
def f(t):
return int(t//1)
if N>=B:
M=f(A*x/B)-A*f(x/B)
print (M)
else:
N=f(A*N/B)-A*f(N/B)
print (N)
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 89 |
#include <bits/stdc++.h>
#define pb push_back
#define MOD 1000000007
#define pii pair<int, int>
#define LL long long int
using namespace std;
void solve() {
LL a, b, n;
cin >> a >> b >> n;
if (n >= b - 1) {
cout << floor((a * (b - 1)) / b) << "\n";
} else {
LL x = n - 1;
LL ans = floor((a * x) / b)... | #include <bits/stdc++.h>
#define pb push_back
#define MOD 1000000007
#define pii pair<int, int>
#define LL long long int
using namespace std;
void solve() {
LL a, b, n;
cin >> a >> b >> n;
if (n >= b - 1) {
cout << floor((a * (b - 1)) / b) << "\n";
} else {
LL x = n;
LL ans = floor((a * x) / b) - a... | [["-", 0, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["-", 0, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 161 |
import math
A,B,N = map(int, input().split())
def calc(x):
y = math.floor(A * x / B) - A * math.floor(x / B)
return y
max_v = 0
if N < B:
max_v = calc(N)
else:
max_v = calc(B)
# for x in range(N+1):
# print(x,max_v) # x=Bでさちる
# max_v = max(max_v, calc(x))
print(max_v)
| import math
A,B,N = map(int, input().split())
def calc(x):
y = math.floor(A * x / B) - A * math.floor(x / B)
return y
max_v = 0
if N < B:
max_v = calc(N)
else:
max_v = calc(B-1)
# for x in range(N+1):
# print(x,max_v) # x=Bでさちる
# max_v = max(max_v, calc(x))
print(max_v)
| [["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 80 |
import math
a, b, n = map(int, input().split())
x = 0
ans = 0
if n < b:
x = n
ans = math.floor(a*x/b) - a * math.floor(x/b)
else:
x = n - 1
ans = math.floor(a*x/b) - a * math.floor(x/b)
print(ans) | import math
a, b, n = map(int, input().split())
x = 0
ans = 0
if n < b:
x = n
ans = math.floor(a*x/b) - a * math.floor(x/b)
else:
x = b - 1
ans = math.floor(a*x/b) - a * math.floor(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 | 91 |
import numpy as np
import pprint
import math
a, b, n = map(int, input().split())
s = min(n, b)
ans = math.floor(a * s / b) - a * math.floor(s / b)
print(ans) | import numpy as np
import pprint
import math
a, b, n = map(int, input().split())
s = min(n, b - 1)
ans = math.floor(a * s / b) - a * math.floor(s / b)
print(ans)
| [["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 61 |
#include <bits/stdc++.h>
int d() {
long long a, b, n;
std::cin >> a >> b >> n;
long long ans = 0;
long long num = 0;
if (b < n) {
num = b - 1;
} else {
num = n;
}
ans = ((a * num) / b) - (a * (num / b));
std::cout << ans << std::endl;
return 0;
}
int main(int argc, const char *argv[]) ... | #include <bits/stdc++.h>
int d() {
long long a, b, n;
std::cin >> a >> b >> n;
long long ans = 0;
long long num = 0;
if (b <= n) {
num = b - 1;
} else {
num = n;
}
ans = ((a * num) / b) - (a * (num / b));
std::cout << ans << std::endl;
return 0;
}
int main(int argc, const char *argv[])... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 116 |
def floor(a,b,x)
((a*x/b).to_i)- ((x/b).to_i * a).to_i
end
nums=gets.strip.split(" ").map do |i|
i.to_i
end
a=nums[0]
b=nums[1]
n=nums[2]
n_x=1
max = 0
x = n<=b ? b-1 : n
puts floor(a,b,x) | def floor(a,b,x)
((a*x/b).to_i)- ((x/b).to_i * a).to_i
end
nums=gets.strip.split(" ").map do |i|
i.to_i
end
a=nums[0]
b=nums[1]
n=nums[2]
n_x=1
max = 0
x = n<b ? n : b-1
puts floor(a,b,x) | [["-", 0, 493, 0, 662, 12, 754, 15, 738, 17, 19], ["+", 0, 493, 0, 662, 12, 754, 15, 738, 17, 18], ["+", 36, 36, 0, 493, 0, 662, 12, 754, 64, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 754, 0, 102], ["-", 36, 36, 0, 493, 0, 662, 12, 754, 0, 102], ["-", 36, 36, 0, 493, 0, 662, 12, 754, 75, 22]] | 4 | 101 |
A,B,N=map(int,input().split())
if N>=B:
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 N>=B:
print(int(A*(B-1)/B)-A*int((B-1)/B))
else:
print(int(A*(N)/B)-A*int(N/B))
| [["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 25]] | 5 | 73 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
// template {{{ 0
// using {{{ 1
using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scan... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
// template {{{ 0
// using {{{ 1
using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scan... | [["-", 3, 4, 0, 16, 31, 16, 31, 23, 0, 24], ["-", 0, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["-", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 3, 4, 0, 16, 31, 16, 31, 23, 0, 25]] | 1 | 272 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
// GCD, LCM
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll f(ll x, ll A, ll B) { return floor(A * x / B) - A * floor(x / B); }
int main() {
ll A, B, N, M = 0, temp;
cin >> A >> B >> N;
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
// GCD, LCM
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll f(ll x, ll A, ll B) { return floor(A * x / B) - A * floor(x / B); }
int main() {
ll A, B, N, M = 0, temp;
cin >> A >> B >> N;
... | [["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 160 |
#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, o) for (ll i = 1; i <= (o); ++i)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)
typedef long long ll;
typedef unsigned long long ull;... | #include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, o) for (ll i = 1; i <= (o); ++i)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)
typedef long long ll;
typedef unsigned long long ull;... | [["-", 0, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 23, 0, 16, 17, 85], ["-", 0, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 31, 22], ["-", ... | 1 | 191 |
#include <bits/stdc++.h>
#define INF INT_MAX
#define UINF UINT_MAX
#define MOD 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef std::pair<int, int> pii;
using namespace std;
ll temp(ll a, ll b, ll x) {
ll axb = (long double)(a * x) / (lon... | #include <bits/stdc++.h>
#define INF INT_MAX
#define UINF UINT_MAX
#define MOD 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef std::pair<int, int> pii;
using namespace std;
ll temp(ll a, ll b, ll x) {
ll axb = (long double)(a * x) / (lon... | [["+", 49, 50, 51, 41, 15, 16, 12, 16, 17, 33], ["+", 49, 50, 51, 41, 15, 16, 12, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 41, 64, 16, 17, 33], ["+", 0, 43, 49, 50, 51, 41, 64, 16, 12, 13]] | 1 | 168 |
#include <cmath>
#include <iostream>
using namespace std;
int main(void) {
long long a, b, n, i;
cin >> a >> b >> n;
int max = floor(a * n / b) - a * floor(n / b);
int k = n / b;
for (i = b * k; i >= 0; i -= b) {
int f = floor(a * i / b) - a * floor(i / b);
if (max < f) {
max = f;
}
}
c... | #include <cmath>
#include <iostream>
using namespace std;
int main(void) {
long long a, b, n, i;
cin >> a >> b >> n;
int max = floor(a * n / b) - a * floor(n / b);
int k = n / b;
for (i = b * k - 1; i >= 0; i -= b) {
int f = floor(a * i / b) - a * floor(i / b);
if (max < f) {
max = f;
}
}... | [["+", 8, 9, 0, 7, 10, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 10, 11, 12, 16, 12, 13]] | 1 | 121 |
#include <bits/stdc++.h>
using namespace std;
long long A;
long long B;
long long N;
long long floor_func(long long x) { return (A * x / B) - A * (x / B); }
int main() {
cin >> A >> B >> N;
long long ans = floor_func(N);
if (N >= B) {
long long x = (N / B) * B - 1;
while (x > B) {
long long tmp =... | #include <bits/stdc++.h>
using namespace std;
long long A;
long long B;
long long N;
long long floor_func(long long x) { return (A * x / B) - A * (x / B); }
int main() {
cin >> A >> B >> N;
long long ans = floor_func(N);
if (N >= B) {
long long x = (N / B) * B - 1;
while (true) {
long long tmp = ... | [["-", 64, 9, 0, 52, 15, 339, 51, 16, 31, 22], ["-", 64, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["-", 64, 9, 0, 52, 15, 339, 51, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 52, 15, 339, 51, 146]] | 1 | 134 |
A,B,N = map(int,input().split())
S = 0
n = N // B
r = N % B
if B > N:
S = (A*N)//B
else:
if r == 0:
S = (A*(N-1))//B - A * (N-1//B)
elif r == B - 1:
S = (A*N)//B - A * (N//B)
else:
S = (A*(n*B-1))//B - A * ((n*B-1)//B)
print(S)
| A,B,N = map(int,input().split())
S = 0
n = N // B
r = N % B
if B > N:
S = (A*N)//B
else:
if r == 0:
S = (A*(N-1))//B - A * ((N-1)//B)
elif r == B - 1:
S = (A*N)//B - A * (N//B)
else:
S = (A*(n*B-1))//B - A * ((n*B-1)//B)
print(S)
| [["+", 12, 657, 12, 23, 0, 657, 31, 23, 0, 24], ["+", 12, 657, 12, 23, 0, 657, 31, 23, 0, 25]] | 5 | 134 |
a, b, n = [int(x) for x in input().split()]
y = min(b, n)
print((a*y)//b) | a, b, n = [int(x) for x in input().split()]
y = min(b-1, n)
print((a*y)//b) | [["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 40 |
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i... | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i... | [["+", 0, 11, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 323 |
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < n; i++)
#define REPR(i, n) for (int64_t i = n; i >= 0; i--)
#define FOR(i, m, n) for (int64_t i = m; i < n; i++)
#define FORR(i, m, n) for (int64_t i = m; i >= n; i--)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
templat... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < n; i++)
#define REPR(i, n) for (int64_t i = n; i >= 0; i--)
#define FOR(i, m, n) for (int64_t i = m; i < n; i++)
#define FORR(i, m, n) for (int64_t i = m; i >= n; i--)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
templat... | [["-", 64, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]] | 1 | 382 |
a, b, n = map(int, input().split())
if b == 1:
x = 0
if n <= b:
x = n
else:
x = b - 1
print((a*x)//b - a*(x//b)) | a, b, n = map(int, input().split())
if b == 1:
x = 0
if n < b:
x = n
else:
x = b - 1
print((a*x)//b - a*(x//b)) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18]] | 5 | 59 |
#include "bits/stdc++.h"
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << endl
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
long long a, b;
cin >> a >> b;
long long n;
cin >> n;
// for(int i=1;i<=n;i++){
// cout<<(a*i)/b<<" "<<a*(i/b)<<endl;;
//}
long long ans ... | #include "bits/stdc++.h"
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << endl
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
long long a, b;
cin >> a >> b;
long long n;
cin >> n;
// for(int i=1;i<=n;i++){
// cout<<(a*i)/b<<" "<<a*(i/b)<<endl;;
//}
long long ans ... | [["+", 12, 23, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 12, 23, 0, 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 | 98 |
//競技プログラミング用のテンプレート
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
using ll = lon... | //競技プログラミング用のテンプレート
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
using ll = lon... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 158 |
import math
A,B,N=map(int,input().split())
if B==1:
print(0)
else:
if B >= N:
print(math.floor(A*N/B))
else:
print(math.floor(A*(B-1)/B))
| import math
A,B,N=map(int,input().split())
if B==1:
print(0)
else:
if B > N:
print(math.floor(A*N/B))
else:
print(math.floor(A*(B-1)/B))
| [["-", 75, 76, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 47]] | 5 | 68 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n); i >= 0; --i)
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n); i >= 0; --i)
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);... | [["+", 12, 23, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 12, 23, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 119 |
#include <bits/stdc++.h>
#define fr first
#define se second
using namespace std;
const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;
long long a;
long long b;
long long n;
int main() {
ios_base::sync_with_stdio(false);
cin >> a >> b >> n;
long long x = min(n, b) - (b ==... | #include <bits/stdc++.h>
#define fr first
#define se second
using namespace std;
const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;
long long a;
long long b;
long long n;
int main() {
ios_base::sync_with_stdio(false);
cin >> a >> b >> n;
long long x = min(n, b) - (b <=... | [["-", 49, 50, 51, 16, 12, 23, 0, 16, 17, 60], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 17, 19]] | 1 | 113 |
#include <algorithm>
#include <cassert>
#include <cfenv>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
double a, b, n;
cin >> a >> b >> n;
map<int, int> an;
int count = 0;
double i = 0;
int... | #include <algorithm>
#include <cassert>
#include <cfenv>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
double a, b, n;
cin >> a >> b >> n;
map<int, int> an;
int count = 0;
double i = 0;
int... | [["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 155 |
from math import floor
a,b,n = map(int, input().split())
i = min(n,b)
print(floor(a*i/b) - a*floor(i/b)) | from math import floor
a,b,n = map(int, input().split())
i = min(n,b-1)
print(floor(a*i/b) - a*floor(i/b)) | [["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 50 |
a, b, x = map(int, input().split())
print(a * (b - 1) // b) | a, b, n = map(int, input().split())
print(a * min(n, b - 1) // b) | [["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["+", 3, 4, 0, 657, 31, 657, 12, 652, 63, 22], ["+", 0, 657, 31, 657, 12, 652, 3, 4, 0, 22], ["+", 0, 657, 31, 657, 12, 652, 3, 4, 0, 21]] | 5 | 30 |
a, b, n = [int(i) for i in input().split()]
m = n % b if n >= b else n
print((a * m // b) - a * (m // b))
| a, b, n = [int(i) for i in input().split()]
m = b - 1 if n >= b else n
print((a * m // b) - a * (m // b))
| [["-", 0, 1, 0, 662, 12, 41, 0, 657, 31, 22], ["-", 0, 1, 0, 662, 12, 41, 0, 657, 17, 109], ["+", 0, 1, 0, 662, 12, 41, 0, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 41, 0, 657, 12, 612]] | 5 | 51 |
A,B,N=map(int,input().split())
s=0
if B<N:
x=B-1
s=(A*x)//B - A*(x//B)
else:
x=N
s=(A*x)//B - A*(x//B)
print(s) | A,B,N=map(int,input().split())
s=0
if B<=N:
x=B-1
s=(A*x)//B - A*(x//B)
else:
x=N
s=(A*x)//B - A*(x//B)
print(s) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]] | 5 | 74 |
import math
A,B,N=map(int, input().split())
b=0
if N>B:
b=B-1
else:
b=N
c=math.floor(A*b/B)-A*math.floor(b/B)
print(c) | import math
A,B,N=map(int, input().split())
b=0
if N>=B:
b=B-1
else:
b=N
c=math.floor(A*b/B)-A*math.floor(b/B)
print(c) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 65 |
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
A, B, N = MAP()
left, right = 0, N
def f(x):
return int(A*x/B) - A*int(x/B)
# while right-left > 1:
# mid1 = (left + right)*1// 3
# mid2 = (left + right)*2// 3
# if f(mid1)... | def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
A, B, N = MAP()
left, right = 0, N
def f(x):
return int(A*x/B) - A*int(x/B)
# while right-left > 1:
# mid1 = (left + right)*1// 3
# mid2 = (left + right)*2// 3
# if f(mid1)... | [["-", 12, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["-", 12, 652, 3, 4, 0, 657, 31, 657, 17, 48]] | 5 | 143 |
a,b,n=map(int,input().split())
if n>=b:
print(int(b-1)/b*a)
else:
print(int(n/b*a)) | a,b,n=map(int,input().split())
if n>=b:
print(int((b-1)/b*a))
else:
print(int(n/b*a)) | [["+", 3, 4, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 49 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long A = sc.nextLong();
long B = sc.nextLong();
long N = sc.nextLong();
if (B == 1) {
System.out.println(0);
} else {
long C = Math.min(B, N);
long D = A * C ... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long A = sc.nextLong();
long B = sc.nextLong();
long N = sc.nextLong();
long D;
if (B == 1) {
System.out.println(0);
} else {
long C = Math.min(B - 1, N);
... | [["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 141, 22], ["+", 8, 498, 0, 195, 8, 196, 0, 503, 0, 35], ["+", 49, 200, 51, 492, 3, 4, 0, 16, 17, 33], ["+", 49, 200, 51, 492, 3, 4, 0, 16, 12, 499], ["-", 0, 57, 75, 196, 0, 503, 39, 506, 0, 96]] | 3 | 112 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long a, b, n;
scanf("%ld%ld%ld", &a, &b, &n);
long x = n;
if (b - 1 < n)
x = b - 1;
printf("%ld\n", floor(a * (x % b) / b));
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long a, b, n;
scanf("%ld%ld%ld", &a, &b, &n);
long x = n;
if (b - 1 < n)
x = b - 1;
printf("%ld\n", a * (x % b) / b);
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]] | 1 | 75 |
#include <bits/stdc++.h>
using namespace std;
const long INF = 1L << 60;
int main() {
long a, b, n;
scanf("%ld%ld%ld", &a, &b, &n);
if (b >= n)
printf("%ld\n", (long)(floor(a * n / b) - a * floor(n / b)));
else
printf("%ld\n", (long)(floor(a * (b - 1) / b) - a * floor((b - 1) / b)));
}
| #include <bits/stdc++.h>
using namespace std;
const long INF = 1L << 60;
int main() {
long a, b, n;
scanf("%ld%ld%ld", &a, &b, &n);
if (b - 1 >= n)
printf("%ld\n", (long)(floor(a * n / b) - a * floor(n / b)));
else
printf("%ld\n", (long)(floor(a * (b - 1) / b) - a * floor((b - 1) / b)));
}
| [["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]] | 1 | 120 |
A, B, N = map(int, input().split())
print(A * min(B, N) // B)
| A, B, N = map(int, input().split())
print(A * min(B-1, N) // B)
| [["+", 31, 657, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 31, 657, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 31 |
#include <bits/stdc++.h>
#define GO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
const int N = 1e5 + 2;
const int M = 1e3 + 5;
const int Mod = 1e9 + 7;
ll a, b, n;
ll f(ll x) { return a * x / b - a * (x / b); }
int main() {
GO;
cin >> a >> b ... | #include <bits/stdc++.h>
#define GO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
const int N = 1e5 + 2;
const int M = 1e3 + 5;
const int Mod = 1e9 + 7;
ll a, b, n;
ll f(ll x) { return a * x / b - a * (x / b); }
int main() {
GO;
cin >> a >> b ... | [["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 134 |
import math
n = list(map(int,input().split()))
x = min(b-1 , n[2])
if n[2] >= n[2]:
print(math.floor(n[0] * x / n[1])) | import math
n = list(map(int,input().split()))
x = min(n[1]-1 , n[2])
if n[2] >= n[2]:
print(math.floor(n[0] * x / n[1])) | [["-", 0, 662, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 206, 51, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 206, 0, 70], ["+", 12, 652, 3, 4, 0, 657, 31, 206, 206, 612], ["+", 12, 652, 3, 4, 0, 657, 31, 206, 0, 73]] | 5 | 62 |
[A,B,N] = list(map(int,input().split()))
X = N
Y = min(B-1,N)
out1 = A*X//B - A*(X//B)
out2 = A*Y//B - A*(Y//B)
print(min(out1,out2))
| [A,B,N] = list(map(int,input().split()))
X = N
Y = min(B-1,N)
out1 = A*X//B - A*(X//B)
out2 = A*Y//B - A*(Y//B)
print(max(out1,out2)) | [["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22]] | 5 | 75 |
[A,B,N] = list(map(int,input().split()))
X = N
Y = min(B-1,N)
out1 = int(A*X/B) - A*int(X/B)
out2 = int(A*Y/B) - A*int(Y/B)
print(min(out1,out2))
| [A,B,N] = list(map(int,input().split()))
X = N
Y = min(B-1,N)
out1 = int(A*X/B) - A*int(X/B)
out2 = int(A*Y/B) - A*int(Y/B)
print(out2)
| [["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 83 |
#define ll long long
#include "bits/stdc++.h"
using namespace std;
vector<pair<ll, ll>> vc;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll res = min(b, n - 1);
cout << (a * res) / b - (a * ((res) / b));
}
| #define ll long long
#include "bits/stdc++.h"
using namespace std;
vector<pair<ll, ll>> vc;
int main() {
ll a, b, n;
cin >> a >> b >> n;
ll res = min(b - 1, n);
cout << (a * res) / b - (a * ((res) / b));
}
| [["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22]] | 1 | 77 |
from math import floor
from collections import deque
def main():
A,B,N=map(int,input().split())
ans1=min(N,B)
ans2=floor(A*ans1/B)-A*floor(ans1/B)
print(ans2)
if __name__=="__main__":
main()
| from math import floor
def main():
A,B,N=map(int,input().split())
ans1=min(N,B-1)
ans2=floor(A*ans1/B)-A*floor(ans1/B)
print(ans2)
if __name__=="__main__":
main()
| [["-", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["-", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["-", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["-", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 72 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
int64_t A, B, N;
int64_t maxt = 0;
cin >> A >> B >> N;
maxt = max(B - 1, N);
cout << (A * maxt) / B - A * (maxt / B) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
int64_t A, B, N;
int64_t maxt = 0;
cin >> A >> B >> N;
maxt = min(B - 1, N);
cout << (A * maxt) / B - A * (maxt / B) << endl;
}
| [["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22]] | 1 | 71 |
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#includ... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#includ... | [["+", 31, 16, 12, 16, 31, 16, 12, 2, 63, 22]] | 1 | 116 |
from sys import stdin
A, B, N = [int(x) for x in stdin.readline().rstrip().split()]
ans1 = int((A*N)/B)-A*(N/B)
if B-1<=N:
ans2 = (A*(B-1))//B
else:
ans2=0
print(max(ans1,ans2)) | from sys import stdin
A, B, N = [int(x) for x in stdin.readline().rstrip().split()]
ans1 = ((A*N)//B)-A*int(N/B)
if B-1<=N:
ans2 = (A*(B-1))//B
else:
ans2=0
print(max(ans1,ans2)) | [["-", 0, 1, 0, 662, 12, 657, 31, 652, 63, 22], ["-", 12, 657, 31, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 676], ["+", 0, 662, 12, 657, 12, 657, 12, 652, 63, 22]] | 5 | 86 |
a, b, n = map(int, input().split())
def f(x):
return (a * x) // b - (a * x) // b
print(f(min(n,b-1))) | a, b, n = map(int, input().split())
def f(x):
return (a * x) // b - a * (x // b)
print(f(min(n, b-1)))
| [["-", 0, 37, 0, 657, 12, 657, 31, 23, 0, 24], ["+", 0, 37, 0, 657, 12, 657, 12, 23, 0, 24], ["-", 0, 37, 0, 657, 12, 657, 31, 23, 0, 25], ["+", 0, 37, 0, 657, 12, 657, 12, 23, 0, 25]] | 5 | 54 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong(), b = sc.nextLong(), n = sc.nextLong(), x, f;
x = Math.min((b - 1), n);
f = (a * n / b) - a * (n / b);
System.out.print(f);
}
} | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong(), b = sc.nextLong(), n = sc.nextLong(), x, f;
x = Math.min((b - 1), n);
f = (a * x / b) - a * (x / b);
System.out.print(f);
}
} | [["-", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["-", 12, 16, 12, 16, 12, 23, 0, 16, 31, 22], ["+", 12, 16, 12, 16, 12, 23, 0, 16, 31, 22]] | 3 | 106 |
a, b, n = map(int, input().split())
if b == 1 or a == 1:
print(0)
else:
r = min(b-1, n)
s = (a * r) // b - a * (r // b)
print(r) | a, b, n = map(int, input().split())
if b == 1 or a == 1:
print(0)
else:
r = min(b-1, n)
s = (a * r) // b - a * (r // b)
print(s)
| [["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 64 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (n >= b) {
cout << floor((a * b - 1) / b) - a * floor((b - 1) / b);
} else
cout << floor((a * n) / b) - a * floor(n / b);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (n >= b) {
cout << floor((a * (b - 1) / b)) - a * floor((b - 1) / b);
} else
cout << floor((a * n) / b) - a * floor(n / b);
return 0;
}
| [["+", 0, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 16, 31, 2, 3, 4, 0, 23, 0, 25]] | 1 | 95 |
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define int long long... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define int long long... | [["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["-", 12, 16, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 16, 12, 16, 12, 23, 0, 16, 12, 22]] | 1 | 299 |
#include <bits/stdc++.h>
#include <cmath>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
long long A, B, N;
cin >> A >> B >> N;
long long x;
if (B < N) {
x = B - 1;
} else {
x = N;
}
cout << A * x / B;
} | #include <bits/stdc++.h>
#include <cmath>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
long long A, B, N;
cin >> A >> B >> N;
long long x;
if (N >= B) {
x = B - 1;
} else {
x = N;
}
cout << A * x / B;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 65 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inc... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inc... | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33]] | 1 | 390 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n, x, sum1;
cin >> a >> b >> n;
if (n > b)
x = b - 1;
else
x = n;
sum1 = floor(a * x / b) - a * floor(x / b);
cout << sum1;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n, x, sum1;
cin >> a >> b >> n;
if (n > b - 1)
x = b - 1;
else
x = n;
sum1 = floor(a * x / b) - a * floor(x / b);
cout << sum1;
}
| [["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]] | 1 | 73 |
#include "bits/stdc++.h"
using namespace std;
void Main() {
long long A, B, N;
cin >> A >> B >> N;
long long d = (B < N) ? B - 1 : N;
double ansD = ((double)A / (double)B) * (double)d;
long long ans = (long long)ansD;
cout << ans << endl;
}
int main() {
std::cout << std::fixed << std::setprecision(15)... | #include "bits/stdc++.h"
using namespace std;
void Main() {
long long A, B, N;
cin >> A >> B >> N;
long long d = (B <= N) ? B - 1 : N;
double ansD = ((double)A / (double)B) * (double)d;
long long ans = (long long)ansD;
cout << ans << endl;
}
int main() {
std::cout << std::fixed << std::setprecision(15... | [["-", 49, 50, 51, 41, 15, 23, 0, 16, 17, 18], ["+", 49, 50, 51, 41, 15, 23, 0, 16, 17, 19]] | 1 | 110 |
import sys
A,B,N=map(int,input().split())
X=B-1
X=max(B-1,N)
ans=(A*X)//B-A*(X//B)
print(ans) | import sys
A,B,N=map(int,input().split())
X=B-1
X=min(B-1,N)
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 | 56 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, N;
cin >> A >> B >> N;
if (B < N) {
cout << A * N / B << endl;
}
else {
cout << A * (B - 1) / B << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long A, B, N;
cin >> A >> B >> N;
if (B - 1 > N) {
cout << A * N / B << endl;
}
else {
cout << A * (B - 1) / B << endl;
}
}
| [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 62 |
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
using namespace std;
int main() {
ll A, B, N, x, ans;
cin >> A >> B >> ... |
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
using namespace std;
int main() {
ll A, B, N, x, ans;
cin >> A >> B >> ... | [["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 109], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22]] | 1 | 88 |
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
ll n, a, b;
while (cin >> a >> b >> n) {
ll ans = 0;
ans = a * (n - 1) / b - a * ((n - 1) / b);
for (ll i = 1, j = b - 1; i <= 1000000 && j <=... | #include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
ll n, a, b;
while (cin >> a >> b >> n) {
ll ans = 0;
ans = a * (n) / b - a * ((n) / b);
for (ll i = 1, j = b - 1; i <= b && j <= n; ++i, j += ... | [["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 31, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["-", 12, 23, 0, 16, 31, 23, 0, 16, 17, 33], ["-", 12, 23, 0, 16, 31, 23, 0, 16, 12, 13], ["-", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 22]] | 1 | 141 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.