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 |
|---|---|---|---|---|
A, B, N = map(int, input().split())
if N < B:
print((A * N) // B)
else:
print(A - (A + B) // B + 1)
| A, B, N = map(int, input().split())
if N < B:
print((A * N) // B)
else:
print(A - (A + B - 1) // B)
| [["+", 0, 657, 12, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 657, 12, 657, 31, 23, 0, 657, 12, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]] | 5 | 49 |
A,B,N = map(int,input().split())
n = min(B-1,N%B)
ans = (A*n)//B
print(ans) | A,B,N = map(int,input().split())
n = min(B-1,N)
ans = (A*n)//B
print(ans) | [["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 109], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 22]] | 5 | 43 |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ini(a, i) memset(a, i, sizeof(a))
#define pb push_back
#define ll long long
int main() {
std::ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// ll tt; cin>>tt; while(tt--)
{
ll n, a, b, i;
cin >> a >> b >> n;
if ... | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ini(a, i) memset(a, i, sizeof(a))
#define pb push_back
#define ll long long
int main() {
std::ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// ll tt; cin>>tt; while(tt--)
{
ll n, a, b, i;
cin >> a >> b >> n;
if ... | [["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 135 |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define mpi map<int, int>
#define vi vector<int>
#define si set<int>
#define pii pair<int, int>
#define vpi vector<pii>
#define vs vector<string>
#define pri priority_queue<int>
#define mp make_pair
#define ff first
#define ss ... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define mpi map<int, int>
#define vi vector<int>
#define si set<int>
#define pii pair<int, int>
#define vpi vector<pii>
#define vs vector<string>
#define pri priority_queue<int>
#define mp make_pair
#define ff first
#define ss ... | [["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 48]] | 1 | 225 |
a,b,n = map(int, input().split())
x = (b-1,n)
print(int(a*x/b)) | a,b,n = map(int, input().split())
x = min(b-1,n)
print(int(a*x/b)) | [["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]] | 5 | 38 |
a,b,n=map(int,input().split())
x=0
if n>b:
x=b-1
else:
x=n
ans=int(a*x/b)-a*int(x/b)
print(ans)
| a,b,n=map(int,input().split())
x=0
if n>b-1:
x=b-1
else:
x=n
ans=int(a*x/b)-a*int(x/b)
print(ans) | [["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]] | 5 | 59 |
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
template <typename T> std::vector<T> make_v(size_t a) {
return std::vector<T>(a);
}
template <typename T, typename... Ts> auto make_v(size_t a, T... | #include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
template <typename T> std::vector<T> make_v(size_t a) {
return std::vector<T>(a);
}
template <typename T, typename... Ts> auto make_v(size_t a, T... | [["-", 0, 43, 49, 50, 51, 2, 63, 343, 141, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 343, 141, 22]] | 1 | 185 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll A, B, N;
cin >> A >> B >> N;
if (N < B) {
cout << (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 (N < B) {
cout << (A * N) / B << endl;
} else {
cout << (A * (B - 1)) / B - A * ((B - 1) / B) << endl;
}
} | [["+", 12, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 12, 16, 12, 23, 0, 25]] | 1 | 81 |
a,b,n=map(int,input().split())
x=max(b-1,n)
print((a*x)//b)
| a,b,n=map(int,input().split())
x=min(b-1,n)
print((a*x)//b) | [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]] | 5 | 38 |
a, b, n = map(int, input().split())
if a==1:
print(0)
else:
c = max(b-1, n)
print((a*c)//b)
| a, b, n = map(int, input().split())
if a==1:
print(0)
else:
c = min(b-1, n)
print((a*c)//b)
| [["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]] | 5 | 49 |
#include <iostream>
using namespace std;
#include <algorithm>
#include <cmath>
int main() {
long int a, b, n, high = 0, i, temp;
scanf("%ld %ld %ld", &a, &b, &n);
i = min(b - 1, n);
temp = floor(a * i / b) - a * floor(i / b);
printf("%ld", high);
return 0;
} | #include <iostream>
using namespace std;
#include <algorithm>
#include <cmath>
int main() {
long int a, b, n, high = 0, i;
scanf("%ld %ld %ld", &a, &b, &n);
i = min(b - 1, n);
high = floor(a * i / b) - a * floor(i / b);
printf("%ld", high);
return 0;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22]] | 1 | 91 |
A, B, N = map(int, input().split())
if N < B:
ans = int(A * N / B) - A * int(N / B)
else:
ans = int(B - 1 / B * A)
print(ans)
| A, B, N = map(int, input().split())
if N < B:
ans = int(A * N / B) - A * int(N / B)
else:
ans = int((B - 1) / B * A)
print(ans) | [["+", 3, 4, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 3, 4, 0, 657, 31, 657, 31, 23, 0, 25]] | 5 | 60 |
import java.lang.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long A = scan.nextLong();
long B = scan.nextLong();
long N = scan.nextLong();
long k;
long u;
long l;
long p;
long ans;
long preans;
... | import java.lang.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long A = scan.nextLong();
long B = scan.nextLong();
long N = scan.nextLong();
long k;
long u;
long l;
long p;
long ans;
long preans;
... | [["-", 8, 196, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 0, 1, 0, 11, 12, 16, 12, 16, 31, 22], ["-", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48], ["-", 0, 1, 0, 11, 12, 16, 12, 16, 12, 22]] | 3 | 159 |
from math import floor
def f(x):
return floor(a*x/b) - a*floor(x/b)
a,b,n = map(int,input().split())
print(min(b-1,n)) | 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(b-1,n))) | [["+", 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, 25]] | 5 | 57 |
#include <bits/stdc++.h>
using namespace std;
void solve(std::istream &ist, std::ostream &ost) {
/* ------- 宣言と入力 ------- */
long long A, B, N;
ist >> A >> B >> N;
/* ------- 計算 ------- */
int x;
if (B == 1) {
ost << "0" << endl;
}
if (B > N) {
x = N;
} else {
x = B - 1;
}
int tm... | #include <bits/stdc++.h>
using namespace std;
void solve(std::istream &ist, std::ostream &ost) {
/* ------- 宣言と入力 ------- */
long long A, B, N;
ist >> A >> B >> N;
/* ------- 計算 ------- */
long long x;
if (B == 1) {
ost << "0" << endl;
return;
}
if (B > N) {
x = N;
} else {
x = B ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38]] | 1 | 147 |
#include <bits/stdc++.h>
using namespace std;
void solve(std::istream &ist, std::ostream &ost) {
/* ------- 宣言と入力 ------- */
long long A, B, N;
ist >> A >> B >> N;
/* ------- 計算 ------- */
long long x;
if (B == 1) {
ost << "0" << endl;
}
if (B > N) {
x = N;
} else {
x = B - 1;
}
... | #include <bits/stdc++.h>
using namespace std;
void solve(std::istream &ist, std::ostream &ost) {
/* ------- 宣言と入力 ------- */
long long A, B, N;
ist >> A >> B >> N;
/* ------- 計算 ------- */
long long x;
if (B == 1) {
ost << "0" << endl;
return;
}
if (B > N) {
x = N;
} else {
x = B ... | [["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 35]] | 1 | 130 |
"use strict"
const main =
(input) => {
const {a, b, n} = parser(input);
console.log(maxFloor(a, b, n));
}
const parser =
(inputStr) => {
const [aStr, bStr, nStr] = inputStr.split(' ');
return {
a : Number(aStr),
b : Number(bStr),
n : Number(cStr),
};
... | "use strict"
const main =
(input) => {
const {a, b, n} = parser(input);
console.log(maxFloor(a, b, n));
}
const parser =
(inputStr) => {
const [aStr, bStr, nStr] = inputStr.split(' ');
return {
a : Number(aStr),
b : Number(bStr),
n : Number(nStr),
};
... | [["-", 0, 500, 0, 569, 51, 2, 3, 3, 0, 22], ["+", 0, 500, 0, 569, 51, 2, 3, 3, 0, 22]] | 2 | 208 |
a,b,n=map(int,input().split())
def f(x):
return int(a*x/b)-a*(x//b)
if n<b:
ans =f(n)
else:
t = n
u = b - 1
ans=max(f(t),f(u))
print(ans)
| a,b,n=map(int,input().split())
def f(x):
return a*x//b-a*int(x/b)
if n<b:
ans =f(n)
else:
t = n
u = b - 1
ans=max(f(t),f(u))
print(ans)
| [["-", 8, 196, 0, 37, 0, 657, 31, 652, 63, 22], ["-", 0, 37, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 0, 657, 31, 652, 3, 4, 0, 657, 17, 85], ["+", 8, 196, 0, 37, 0, 657, 31, 657, 17, 676], ["-", 0, 37, 0, 657, 31, 652, 3, 4, 0, 25], ["+", 0, 37, 0, 657, 12, 657, 12, 652, 63, 22], ["-", 0, 657, 12, 657, 12, 23, 0, 657, 17,... | 5 | 80 |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
int floor(long long a, long long b, long long c) {
long long max = 0;
long long anser = 0;
long long anser2 = 0;
if (c > b) {
c = b - 1;
anser = a * c / b;
anser2 = c / b;
max = anser - a * anser2;
} else {
anser = a * c / b;
... | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
int floor(long long a, long long b, long long c) {
long long max = 0;
long long anser = 0;
long long anser2 = 0;
if (c >= b) {
c = b - 1;
anser = a * c / b;
anser2 = c / b;
max = anser - a * anser2;
} else {
anser = a * c / b;
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 165 |
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <assert.h>
#include <bitset>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <assert.h>
#include <bitset>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric... | [["+", 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, 21], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 25]] | 1 | 1,372 |
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();
sc.close();
long n = Long.max(N % B, B - 1);
long ans = n * A / B;
System.out.println(ans);
... | 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();
sc.close();
long n = Long.min(N, B - 1) % B;
long ans = n * A / B;
System.out.println(ans);
... | [["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 0, 503, 49, 200, 51, 16, 31, 492, 141, 22], ["-", 49, 200, 51, 492, 3, 4, 0, 16, 17, 109], ["-", 49, 200, 51, 492, 3, 4, 0, 16, 12, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 17, 109], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 12, 22]] | 3 | 102 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
long a, b, n;
cin >> a >> b >> n;
cout << min(n, b - 1);
return 0;
} | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
long a, b, n;
cin >> a >> b >> n;
cout << a * min(n, b - 1) / b;
return 0;
}
| [["+", 0, 1, 0, 16, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 16, 12, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 22]] | 1 | 43 |
import math
A, B, N = map(int, input().split())
def f(A, B, x):
return math.floor((A * x) / B) - A * math.floor(x / B)
x = N if N < B else B
print(f(A, B, x)) | import math
A, B, N = map(int, input().split())
def f(A, B, x):
return math.floor((A * x) / B) - A * math.floor(x / B)
x = N if N < B else B - 1
print(f(A, B, x)) | [["+", 0, 1, 0, 662, 12, 41, 0, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 41, 0, 657, 12, 612]] | 5 | 74 |
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int(i) = 0; i < (n); i++)
#define REP(i, m, n) for (int(i) = (m); (i) < (n); (i)++)
#define M... | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int(i) = 0; i < (n); i++)
#define REP(i, m, n) for (int(i) = (m); (i) < (n); (i)++)
#define M... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 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 | 360 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
/*
for(long long x = 0; x <= n; x++) {
long long res = (a * x / b) - a * (x / b);
cout << x << ": " << res << endl;
}
*/
// cout << "==" << endl;
long long x;
if (n <= b)
... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
/*
for(long long x = 0; x <= n; x++) {
long long res = (a * x / b) - a * (x / b);
cout << x << ": " << res << endl;
}
*/
// cout << "==" << endl;
long long x;
if (n < b)
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 84 |
import sys
input = sys.stdin.readline
def main():
a, b, n = map(int, input().split())
x = min(n + 1, b - 1)
X = (a * x) // b
Y = a * (x // b)
print(X - Y)
if __name__ == '__main__':
main()
| import sys
input = sys.stdin.readline
def main():
a, b, n = map(int, input().split())
x = min(n, b - 1)
X = (a * x) // b
Y = a * (x // b)
print(X - Y)
if __name__ == '__main__':
main()
| [["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 78 |
import math
A, B, N = list(map(int, input().split(" ")))
if B > N:
print(math.floor(A*i/B) - A * math.floor(i/B))
else:
print(math.floor(A*(B-1)/B)) | import math
A, B, N = list(map(int, input().split(" ")))
if B > N:
print(math.floor(A*N/B) - A * math.floor(N/B))
else:
print(math.floor(A*(B-1)/B)) | [["-", 31, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 31, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 12, 657, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 12, 657, 12, 652, 3, 4, 0, 657, 31, 22]] | 5 | 74 |
A, B, N = map(int, input().split())
if N < B:
print(int(A * N / B))
else:
print(int(A * (N % B) / B)) | A, B, N = map(int, input().split())
if N < B:
print(int(A * N / B))
else:
print(int(A * (B - 1) / B)) | [["-", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["-", 0, 657, 31, 657, 12, 23, 0, 657, 17, 109], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 12, 612]] | 5 | 51 |
a,b,n = map(int,input().split())
if b > n:
print((a*n)//b)
elif b <= n:
print((a*b-1)//b) | a,b,n = map(int,input().split())
if b > n:
print((a*n)//b)
elif b <= n:
print((a*(b-1))//b) | [["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 24], ["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 25]] | 5 | 50 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
if (b > n) {
cout << a * n / b << endl;
} else if (a % b != 0) {
cout << a - 1 - a / b << endl;
} else {
cout << a - 1 << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
if (b > n) {
cout << a * n / b << endl;
} else if (a % b != 0) {
cout << a - 1 - a / b << endl;
} else {
cout << a - a / b << endl;
}
}
| [["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 31, 22], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 17, 85], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 12, 22]] | 1 | 80 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n, res = -1;
cin >> a >> b >> n;
long long i = n;
long long tmp;
if (b == 1) {
cout << 0;
return 0;
}
if (n <= b) {
cout << (a * i) / b - a * (i / b);
return 0;
} else {
cout << (a * (b - 1)) / b - a * ((b - ... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n, res = -1;
cin >> a >> b >> n;
long long i = n;
long long tmp;
if (b == 1) {
cout << 0;
return 0;
}
if (n < b) {
cout << (a * i) / b - a * (i / b);
return 0;
} else {
cout << (a * (b - 1)) / b - a * ((b - 1... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 165 |
// Bismillahir Rahmanir Raheem
// In the name of Allah , Most Gracious , Most Merciful
/*
* * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * *
* * * * * * * *
... | // Bismillahir Rahmanir Raheem
// In the name of Allah , Most Gracious , Most Merciful
/*
* * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * *
* * * * * * * *
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 74 |
A, B, N=list(map(int, input().split()))
if B > N:
X = N
else:
X = B-1
Ans = math.floor(A*X/B) - A * math.floor(X/B)
print(Ans)
| import math
A, B, N=list(map(int, input().split()))
if B > N:
X = N
else:
X = B-1
Ans = math.floor(A*X/B) - A * math.floor(X/B)
print(Ans)
| [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 63 |
import math
a, b, n = map(int, input().split())
if n < b:
print('a')
ans = math.floor(a*n/b) - a * math.floor(n/b)
print(ans)
else:
ans = a - (a-1) // b - 1
print(ans) | import math
a, b, n = map(int, input().split())
if n < b:
ans = math.floor(a*n/b) - a * math.floor(n/b)
print(ans)
else:
ans = a - (a-1) // b - 1
print(ans) | [["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 77 |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define DEBUG(x) cout << '>' ... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define DEBUG(x) cout << '>' ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 394 |
import math
def fun(A, B, x):
return math.floor(A*x/B)-A*math.floor(x/B)
A, B, N = map(int,input().split())
x = min(B, N)
print(int(fun(A, B, x)))
| import math
def fun(A, B, x):
return math.floor(A*x/B)-A*math.floor(x/B)
A, B, N = map(int,input().split())
x = min(B-1, N)
print(int(fun(A, B, x)))
| [["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 74 |
import math
A, B, N = [int(s) for s in input().split()]
if N > B:
x = B - 1
else:
x = N
ans = A * x // B - A * (x // B)
print(ans) | A, B, N = [int(s) for s in input().split()]
if N >= B - 1:
x = B - 1
else:
x = N
ans = A * x // B - A * (x // B)
print(ans) | [["-", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]] | 5 | 58 |
#include <bits/stdc++.h>
using namespace std;
long long a, b, n, x;
int main() {
cin >> a >> b >> n;
if (n > b) {
x = b - 1;
cout << a * x / b << endl;
} else {
x = n;
cout << a * x / b << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
long long a, b, n, x;
int main() {
cin >> a >> b >> n;
if (n >= b) {
x = b - 1;
cout << a * x / b << endl;
} else {
x = n;
cout << a * x / b << endl;
}
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 71 |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define qrep(i, q) for (auto i : q)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = "... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define qrep(i, q) for (auto i : q)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = "... | [["+", 0, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 16, 31, 23, 0, 25]] | 1 | 160 |
// 17571@nith.ac.in @Ankit Verma
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define MP make_pair
#define int long long
#define ll long long
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define ld long double
#define eb emplace_back
#define pii pair<int, int>
#... | // 17571@nith.ac.in @Ankit Verma
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define MP make_pair
#define int long long
#define ll long long
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define ld long double
#define eb emplace_back
#define pii pair<int, int>
#... | [["-", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 261 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define INF (1LL << 50)
#define MOD 1000000007
int main() {
ll A, B, N;
cin >> A >> B >> N;
ll ans = 0;
long double tmp = (long double)A / (long double)B;
// if()
if (B < N) {
ans = (A *... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define INF (1LL << 50)
#define MOD 1000000007
int main() {
ll A, B, N;
cin >> A >> B >> N;
ll ans = 0;
long double tmp = (long double)A / (long double)B;
// if()
if (B <= N) {
ans = (A ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 125 |
#include <bits/stdc++.h>
typedef long long int ll;
#define cases \
int t; \
cin >> t; \
while (t--)
#define FIO... | #include <bits/stdc++.h>
typedef long long int ll;
#define cases \
int t; \
cin >> t; \
while (t--)
#define FIO... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 92 |
import math
#X=int(input())
A,B,N=map(int,input().split())
if B<N:
print(math.floor(A*(B-1)/B)-A*math.floor((B-1)/B))
exit()
else:
print(math.floor(A*(N)/B)-A*math.floor((N)/B))
exit()
| import math
#X=int(input())
A,B,N=map(int,input().split())
if B<=N:
print(math.floor(A*(B-1)/B)-A*math.floor((B-1)/B))
exit()
else:
print(math.floor(A*(N)/B)-A*math.floor((N)/B))
exit()
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]] | 5 | 94 |
# -*- coding:utf-8 -*-
def solve():
A, B, N = list(map(int, input().split()))
def f(x):
return (A*x//B) - A*(x//B)
# 分母のBに注目すると、1 <= x <= B を調べれば良い
if B >= N:
print(f(N))
else:
print(f(B-1))
def solve2():
A, B, N = list(map(int, input().split()))
def f(x):
... | # -*- coding:utf-8 -*-
def solve():
A, B, N = list(map(int, input().split()))
def f(x):
return (A*x//B) - A*(x//B)
# 分母のBに注目すると、1 <= x <= B を調べれば良い
if B > N:
print(f(N))
else:
print(f(B-1))
def solve2():
A, B, N = list(map(int, input().split()))
def f(x):
... | [["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47]] | 5 | 227 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using VI = vector<ll>;
using VD = vector<ld>;
using VVI = vector<VI>;
using VC = vector<char>;
using VVC = vector<VC>;
using VS = vector<string>;
using PLL = pair<ll, ll>;
using PLD = pair<ld, ld>;
using VPLL = vector<PLL>;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using VI = vector<ll>;
using VD = vector<ld>;
using VVI = vector<VI>;
using VC = vector<char>;
using VVC = vector<VC>;
using VS = vector<string>;
using PLL = pair<ll, ll>;
using PLD = pair<ld, ld>;
using VPLL = vector<PLL>;
... | [["-", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["-", 0, 11, 12, 16, 31, 2, 3, 4, 0, 21], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 17, 85], ["-", 0, 11, 12, 16, 12, 16, 12, 2, 63, 22], ["+", 0, 11, 12, 16, 12, 16, 12, 2, 63, 22], ["-", 12, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 12, 16, 1... | 1 | 639 |
a,b,n=map(int,input().split())
if a <= b:
if n > b:
ans=(a*(b-1))//b
else:
ans=(a*n)//b - a*(n//b)
else:
if n > b:
ans=(a*(b-1))//b
else:
ans=(a*n)//b - a*(n//b)
print(ans)
| a,b,n=map(int,input().split())
if a <= b:
if n >= b:
ans=(a*(b-1))//b
else:
ans=(a*n)//b - a*(n//b)
else:
if n >= b:
ans=(a*(b-1))//b
else:
ans=(a*n)//b - a*(n//b)
print(ans)
| [["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 20], ["-", 75, 76, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 20]] | 5 | 103 |
#include <cmath>
#include <iostream>
using namespace std;
int main() {
long A;
long long B, N, x;
cin >> A >> B >> N;
if (N > B)
x = B - 1;
else
x = N;
long long result = floor(A * x / B) - A * floor(x / B);
cout << result << '\n';
return 0;
} | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long A;
long long B, N, x;
cin >> A >> B >> N;
if (N >= B - 1)
x = B - 1;
else
x = N;
long long result = floor(A * x / B) - A * floor(x / B);
cout << result << '\n';
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 | 83 |
from math import floor
A, B, N = map(int, input().split())
ans = 0
if N > B:
x = B - 1
else:
x = N
ans = floor(A*x/B) - A*floor(x/B)
print(ans) | from math import floor
A, B, N = map(int, input().split())
ans = 0
if N >= B:
x = B - 1
else:
x = N
ans = floor(A*x/B) - A*floor(x/B)
print(ans) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 63 |
A, B, N = [int(i) for i in input().split()]
if B == 1:
max = 0
elif B >= N:
x = N
max = ((A * x) // B) - A * (x // B)
else:
x = N
maxn = ((A * x) // B) - A * (x // B)
x = B * (N // B) - 1
maxx = ((A * x) // B) - A * (x // B)
if maxx > maxn:
max = maxx
else:
max = maxn... | A, B, N = [int(i) for i in input().split()]
if B == 1:
max = 0
elif B > N:
x = N
max = ((A * x) // B) - A * (x // B)
else:
x = N
maxn = ((A * x) // B) - A * (x // B)
x = B * (N // B) - 1
maxx = ((A * x) // B) - A * (x // B)
if maxx > maxn:
max = maxx
else:
max = maxn
... | [["-", 0, 656, 0, 57, 75, 665, 15, 666, 667, 20], ["+", 0, 656, 0, 57, 75, 665, 15, 666, 667, 47]] | 5 | 128 |
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
ll a, b, n;
int main() {
cin >> a >> b >> n;
if (n >= b) {
cout << (b - 1) * a / b << e... | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
ll a, b, n;
int main() {
cin >> a >> b >> n;
if (n >= b) {
cout << (b - 1) * a / b << e... | [["-", 31, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["-", 12, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 31, 16, 12, 16, 31, 16, 31, 23, 0, 25]] | 1 | 90 |
#include <iostream>
#include <math.h>
using namespace std;
int main() {
long A, B, N;
cin >> A >> B >> N;
long a, c, d, e;
a = A / B;
c = A % B;
if (N > B) {
e = B - 1;
} else {
e = N;
}
cout << a * e + long((c * e) / B);
return 0;
} | #include <iostream>
#include <math.h>
using namespace std;
int main() {
long long A, B, N;
cin >> A >> B >> N;
long long a, c, d, e;
a = A / B;
c = A % B;
if (N >= B) {
e = B - 1;
} else {
e = N;
}
cout << a * e + long((c * e) / B);
return 0;
} | [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 91 |
A, B, N = map(int, input().split())
if B-1>N:
answer = (A*N/B)//1 - A*((N/B)//1)
if A > B:
answer = (A*(B-1)/B)//1 - A*(((B-1)/B)//1)
print(int(answer))
| A, B, N = map(int, input().split())
if B-1>N:
answer = (A*N/B)//1 - A*((N/B)//1)
else:
answer = (A*(B-1)/B)//1 - A*(((B-1)/B)//1)
print(int(answer))
| [["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95]] | 5 | 91 |
A, B, N = map(int, input().split())
if N > B:
X = (A*(B-1)) // B
Y = A * ((B-1)//B)
print(X-Y)
else:
X = (A*N) // B
Y = A * (N//B)
print(X-Y)
| A, B, N = map(int, input().split())
if N >= B:
X = (A*(B-1)) // B
Y = A * ((B-1)//B)
print(X-Y)
else:
X = (A*N) // B
Y = A * (N//B)
print(X-Y)
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 81 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (n > b)
cout << floor(a * (b - 1) / b) << endl;
else
cout << floor(a * (n) / b) << endl;
return 0;
}
| #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll a, b, n;
cin >> a >> b >> n;
if (n >= b)
cout << floor(a * (b - 1) / b) << endl;
else
cout << floor(a * (n) / b) << endl;
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 72 |
#include <bits/stdc++.h>
#ifdef LOCAL_DEBUG
#define DEBUG 1
#define CERR \
if (DEBUG) \
cerr
#define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME
#define pr(...) ... | #include <bits/stdc++.h>
#ifdef LOCAL_DEBUG
#define DEBUG 1
#define CERR \
if (DEBUG) \
cerr
#define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME
#define pr(...) ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 762 |
a,b,n = map(int,input().split())
import math
if b < n:
print(math.floor(a*(b-1)/b))
else:
print(math.floor((a*n)/b)) | a,b,n = map(int,input().split())
import math
if b <= n:
print(math.floor(a*(b-1)/b))
else:
print(math.floor((a*n)/b)) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]] | 5 | 59 |
#include <bits/stdc++.h>
using namespace std;
#include <cstdlib>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
int main() {
int64_t A, B, N;
cin >> A >> B >> N;
int64_t max_x = min(N - A / B + 1, N);
// if(max_x>=B) max_x = B-1;
int64_t max_y = B - 1;
int64_t ans_x = (A * max_x) / B - A * int64_t... | #include <bits/stdc++.h>
using namespace std;
#include <cstdlib>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
int main() {
int64_t A, B, N;
cin >> A >> B >> N;
int64_t max_x = min(N - A / B + 1, N);
// if(max_x>=B) max_x = B-1;
int64_t max_y = min(N, B - 1);
int64_t ans_x = (A * max_x) / B - A *... | [["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25]] | 1 | 110 |
import sys
readline = sys.stdin.readline
A, B, N = map(int, readline().split())
k = min(B, N)
ans = (A * k - A * k % B) // B
print(ans) | import sys
readline = sys.stdin.readline
A, B, N = map(int, readline().split())
k = min(B - 1, N)
ans = (A * k - A * k % B) // B
print(ans) | [["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 54 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, cc, n) for (int i = cc; i < n; ++i)
#define lrep(i, cc, n) for (long i = cc; i < n; ++i)
#define rrep(i, cc, n) for (long i = cc; i > n; --i)
int main() {
long long A, B, N;
cin >> A >> B >> N;
;
if (N - 1 >= B)
cout << A * (B - 1) / B << endl;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, cc, n) for (int i = cc; i < n; ++i)
#define lrep(i, cc, n) for (long i = cc; i < n; ++i)
#define rrep(i, cc, n) for (long i = cc; i > n; --i)
int main() {
long long A, B, N;
cin >> A >> B >> N;
if (N >= B - 1)
cout << A * (B - 1) / B << endl;
els... | [["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]] | 1 | 98 |
a, b, n = map(int, input().split())
if n <= b:
k = n
else:
k = b
print((a*k)//b - a*(k//b)) | a, b, n = map(int, input().split())
if n < b:
k = n
else:
k = b - 1
print((a*k)//b - a*(k//b)) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 49 |
#include <algorithm>
#include <cstdio>
#include <vector>
using namespace std;
int main() {
long long A, B, N;
scanf("%lld %lld %lld", &A, &B, &N);
N = max(N, B - 1);
printf("%lld", (A * N) / B - A * (N / B));
return 0;
} | #include <algorithm>
#include <cstdio>
#include <vector>
using namespace std;
int main() {
long long A, B, N;
scanf("%lld %lld %lld", &A, &B, &N);
N = min(N, B - 1);
printf("%lld", (A * N) / B - A * (N / B));
return 0;
} | [["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22]] | 1 | 77 |
def main():
a,b,n = map(int,input().split())
aa = min(b,n)
ans = a*aa//b - a * (aa//b)
print(ans)
if __name__=='__main__':
main()
| def main():
a,b,n = map(int,input().split())
aa = min(b-1,n)
ans = a*aa//b - a * (aa//b)
print(ans)
if __name__=='__main__':
main()
| [["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 60 |
#include <stdio.h>
#include <stdlib.h>
int main() {
long int A, B, N, max, y, s;
scanf("%ld %ld %ld", &A, &B, &N);
if (N > B)
y = B - 1;
else
y = N;
s = y / B;
max = A * y / B - A * s;
printf("%ld", max);
return 0;
} | #include <stdio.h>
#include <stdlib.h>
int main() {
long int A, B, N, max, y, s, i;
scanf("%ld %ld %ld", &A, &B, &N);
if (N >= B)
y = B - 1;
else
y = N;
s = y / B;
max = A * y / B - A * s;
printf("%ld", max);
return 0;
} | [["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]] | 0 | 87 |
#!/usr/bin/env python3
A, B, N = map(int, input().split())
num = 0
ans = 0
if N >= B:
print((A*(A-1))//B - A*((A-1)//B))
else:
print((A*N)//B - A*(N//B)) | #!/usr/bin/env python3
A, B, N = map(int, input().split())
num = 0
ans = 0
if N >= B:
print((A*(B-1))//B - A*((B-1)//B))
else:
print((A*N)//B - A*(N//B)) | [["-", 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 | 76 |
import math
a,b,n = list(map(int,input().split()))
if b>=n:
x=n
else:x=b
print(math.floor(a*x/b)-a*math.floor(x/b)) | import math
a,b,n = list(map(int,input().split()))
if b-1>=n:
x=n
else:x=b-1
print(math.floor(a*x/b)-a*math.floor(x/b)) | [["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 60 |
from math import floor
a, b, n = map(int, input().split())
if b == 1:
print(0)
else:
if n <= b:
print((a * n) // b - a * (n //b))
else:
ans = 0
for i in range(b - 1, n + 1, b):
ans = max(ans, (a * i) // b - a * (i //b))
print(ans) | from math import floor
a, b, n = map(int, input().split())
if b == 1:
print(0)
else:
if n < b:
print((a * n) // b - a * (n //b))
else:
ans = 0
for i in range(b - 1, n + 1, b):
ans = max(ans, (a * i) // b - a * (i //b))
print(ans) | [["-", 75, 76, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 18]] | 5 | 103 |
a,b,n = map(int,input().split())
import math
if n < b:
print(int(math.floor(a*n/b) - a*np.floor(n/b)))
else:
print(int(math.floor(a*(b-1)/b) - a*np.floor((b-1)/b))) | a,b,n = map(int,input().split())
import math
if n < b:
print(int(math.floor(a*n/b) - a*math.floor(n/b)))
else:
print(int(math.floor(a*(b-1)/b) - a*math.floor((b-1)/b))) | [["-", 0, 657, 12, 657, 12, 652, 63, 319, 500, 22], ["+", 0, 657, 12, 657, 12, 652, 63, 319, 500, 22]] | 5 | 89 |
#include <stdio.h>
long long n, m, i, j, k, a, b;
int main() {
scanf("%lld%lld%lld", &a, &b, &n);
if (n > b)
n = b - 1;
printf("%lld\n", a * n / b - a * (n / b));
return 0;
} | #include <stdio.h>
long long n, m, i, j, k, a, b;
int main() {
scanf("%lld%lld%lld", &a, &b, &n);
if (n >= b)
n = b - 1;
printf("%lld\n", a * n / b - a * (n / b));
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 77 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return tr... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return tr... | [["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]] | 1 | 162 |
require 'pp'
# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
gets.chomp.split(" ").map(&:to_i)
end
A, B, N = gets_i_list
if B <= N
x = B
puts (A * x / B).floor - A * (x / B).floor
else
x = N
puts (A * x / B).floor - A * (x / B).floor
end | require 'pp'
# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
gets.chomp.split(" ").map(&:to_i)
end
A, B, N = gets_i_list
if B <= N
x = B - 1
puts (A * x / B).floor - A * (x / B).floor
else
x = N
puts (A * x / B).floor - A * (x / B).floor
end | [["+", 0, 121, 64, 749, 0, 662, 12, 738, 17, 33], ["+", 0, 121, 64, 749, 0, 662, 12, 738, 12, 612]] | 4 | 85 |
#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 main() {
long long A, B, N, ans;
cin >> A >> B >> N;
if (N > B) {
ans = (A * (B - 1)) / B;
} else {
ans = (A * N) / B;
}
cout << ans << endl;
return 0;... | #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 main() {
long long A, B, N, ans;
cin >> A >> B >> N;
if (N > B - 1) {
ans = (A * (B - 1)) / B;
} else {
ans = (A * N) / B;
}
cout << ans << endl;
retur... | [["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]] | 1 | 98 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
int main() {
ll A, B, N;
cin >> A >> B >> N;
if (N < B) {
cout << (A * N) / B - A * (N / B) << endl;
} else {
cout << (A * (B - 1)) / B - A * (B - 1 / B) << endl;
}
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
int main() {
ll A, B, N;
cin >> A >> B >> N;
if (N < B) {
cout << (A * N) / B - A * (N / B) << endl;
} else {
cout << (A * (B - 1)) / B - A * ((B - 1) / B) << endl;
}
} | [["+", 12, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 12, 16, 12, 23, 0, 16, 31, 23, 0, 25]] | 1 | 98 |
import math
A,B,N=map(int,input().split())
if(N<=B):
x = N
else:
x =B-1
print(int( math.floor(A*x/B)-A*math.floor(x/B) )) | import math
A,B,N=map(int,input().split())
if(N<B):
x = N
else:
x =B-1
print(int( math.floor(A*x/B)-A*math.floor(x/B) )) | [["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 19], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 18]] | 5 | 64 |
import math
def main():
a, b, n = map(int, input().split())
if n % b == 0:
print(math.floor(a * (n-1) / b) - a * math.floor((n-1) / b))
else:
print(math.floor(a * n / b) - a * math.floor(n / b))
main() | import math
def main():
a, b, n = map(int, input().split())
if n >= b:
print(math.floor(a * (b-1) / b) - a * math.floor((b-1) / b))
else:
print(math.floor(a * n / b) - a * math.floor(n / b))
main() | [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 109], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20], ["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 60], ["-", 0, 14, 8, 196, 0, 57, 15, 666, 0, 612], ["-", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["-", 3, 4, 0, 657, 31, 23, 0, 657,... | 5 | 93 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
long long int c = 0;
if (b < n) {
c = b - 1;
} else
c = n;
cout << (a * c) / b << endl;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
long long int c = 0;
if (b <= n) {
c = b - 1;
} else
c = n;
cout << (a * c) / b << endl;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 73 |
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
a,b,x=MAP()
def f(n):
return (a*n)//b-a*(n//b)
if b<=x:
print(f(b))
else:
print(f(x))
| import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
a,b,x=MAP()
def f(n):
return (a*n)//b-a*(n//b)
if b<=x:
print(f(b-1))
else:
print(f(x))
| [["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]] | 5 | 122 |
#include <stdio.h>
int main() {
long long int a, b, n, minNum, ans;
scanf("%lld%lld%lld", &a, &b, &n);
minNum = (b > n) ? n : b;
ans = (a * minNum) / b;
printf("%lld", ans);
} | #include <stdio.h>
int main() {
long long int a, b, n, minNum, ans;
scanf("%lld%lld%lld", &a, &b, &n);
minNum = (b - 1 > n) ? n : (b - 1);
ans = (a * minNum) / b;
printf("%lld", ans);
} | [["+", 12, 41, 15, 23, 0, 16, 31, 16, 17, 33], ["+", 12, 41, 15, 23, 0, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 41, 75, 23, 0, 24], ["+", 0, 11, 12, 41, 75, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 41, 75, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 41, 75, 23, 0, 25]] | 0 | 68 |
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
ll a, b;
ll func(ll x) { return a * x / b - a * (x / b); }
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n... | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
ll a, b;
ll func(ll x) { return a * x / b - a * (x / b); }
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 118 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long int a, b, n;
cin >> a >> b >> n;
long int ans = 0;
if (b < n)
ans = a * (b - 1) / b;
else
ans = a * n / b;
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
long long int ans;
if (b <= n)
ans = a * (b - 1) / b;
else
ans = a * n / b;
cout << ans << endl;
}
| [["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 67 |
#include <bits/stdc++.h>
using namespace std;
#define all(a) a.begin(), a.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
const int INF = 1 << 30;
const ll INFll = 1LL << 62;
const int mod = int(1e9) + 7;
using V = vector<int>;
using P = pair<int, int>;
int main() {
ll a, b, n;
cin >> ... | #include <bits/stdc++.h>
using namespace std;
#define all(a) a.begin(), a.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
const int INF = 1 << 30;
const ll INFll = 1LL << 62;
const int mod = int(1e9) + 7;
using V = vector<int>;
using P = pair<int, int>;
int main() {
ll a, b, n;
cin >> ... | [["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]] | 1 | 126 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
using ll = long long;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
int maxv = 0;
if (n <= b) {
// n<=bってことは[x/b]=0こていなのでAxがクソでかいほうがい... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
using ll = long long;
int main() {
long long int a, b, n;
cin >> a >> b >> n;
int maxv = 0;
if (n < b) {
// n<=bってことは[x/b]=0こていなのでAxがクソでかいほうがいい... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 161 |
def main():
A, B, N = map(int, input().split(" "))
max_score = -float("inf")
if B <= N:
x = B-1
else:
x = N
score = math.floor((A*x)/B) - A*math.floor(x/B)
print(score)
if __name__ == "__main__":
main() | import math
def main():
A, B, N = map(int, input().split(" "))
max_score = -float("inf")
if B <= N:
x = B-1
else:
x = N
score = math.floor((A*x)/B) - A*math.floor(x/B)
print(score)
if __name__ == "__main__":
main() | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 89 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = 0;
if (n < b) {
ans = ((a * n) / b);
} else if (b == 1 || a == 1) {
ans = 0;
} el... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long ans = 0;
if (n < b) {
ans = ((a * n) / b);
} else if (b == 1 || a == 1) {
ans = 0;
} el... | [["-", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22]] | 1 | 147 |
a, b, n =map(int, input().split())
if b>=n:
ans=(a*n)//b
print(ans)
else:
ans=(a*(b-1)//b)
print(ans) | a, b, n =map(int, input().split())
if b>n:
ans=(a*n)//b
print(ans)
else:
ans=(a*(b-1)//b)
print(ans) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]] | 5 | 55 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c, n) for (int i = c; i < n; i++)
int main() {
double a, b, n, cal1, cal2, x, ans;
cin >> a >> b >> n;
if (n > b) {
x = b - 1;
} else {
x = n;
}
cal1 = ((a * x) / b);
cal2 = (x / b);
ans = floor(cal1) - (a * floor(cal2));
cout << ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, c, n) for (int i = c; i < n; i++)
int main() {
double a, b, n, cal1, cal2, x, ans;
cin >> a >> b >> n;
if (n >= b) {
x = b - 1;
} else {
x = n;
}
cal1 = ((a * x) / b);
cal2 = (x / b);
ans = floor(cal1) - (a * floor(cal2));
cout <<... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 111 |
/*
* @Author: Luisvacson
* @LastEditors: Luisvacson
* @Descriptions: None
* @Date: 2020-05-02 21:13:46
* @LastEditTime: 2020-05-02 21:18:53
* @FilePath: \VSC\C++\Practice\AC abc165 D.cpp
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
int A, B, N;
signed main() {
scanf("%lld%lld%lld", &... | /*
* @Author: Luisvacson
* @LastEditors: Luisvacson
* @Descriptions: None
* @Date: 2020-05-02 21:13:46
* @LastEditTime: 2020-05-02 21:21:27
* @FilePath: \VSC\C++\Practice\AC abc165 D.cpp
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
int A, B, N;
signed main() {
scanf("%lld%lld%lld", &... | [["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]] | 1 | 75 |
#include <bits/stdc++.h>
#define pi 3.1415926536
#define mod 1000000007
#define ll long long int
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repn(i, a, b) for (int i = a; i > b; i--)
#define mod1 1000003
#define mod2 998244353
#define hi "hello"
#define nl "\n"
#define ws " "
#define sz size()
#define len... | #include <bits/stdc++.h>
#define pi 3.1415926536
#define mod 1000000007
#define ll long long int
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repn(i, a, b) for (int i = a; i > b; i--)
#define mod1 1000003
#define mod2 998244353
#define hi "hello"
#define nl "\n"
#define ws " "
#define sz size()
#define len... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 537 |
#!/usr/bin/env python3
import sys
import math
def solve(A: int, B: int, N: int):
print(math.floor(A*min(B, N)/B) - A * math.floor(min(B, N)/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 te... | #!/usr/bin/env python3
import sys
import math
def solve(A: int, B: int, N: int):
print(math.floor(A*min(B-1, N)/B) - A * math.floor(min(B-1, N)/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 custo... | [["+", 31, 657, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 31, 657, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 657, 31, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 657, 31, 652, 3, 4, 0, 657, 12, 612]] | 5 | 138 |
import java.awt.*;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.util.List;
import javax.print.DocFlavor;
public class Main {
static String br = System.getProperty("line.separator");
static Scanner sc = new Scanner(System.in);
static Pri... | import java.awt.*;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.util.List;
import javax.print.DocFlavor;
public class Main {
static String br = System.getProperty("line.separator");
static Scanner sc = new Scanner(System.in);
static Pri... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 60], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]] | 3 | 286 |
#include <bits/stdc++.h>
// Function Macros:
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define setpre(n) cout << fixed << setprecision(n)
// Type / Class / Struct Definitions:
using namespace std;
using ll = long long;
using ull = unsigned long long;
// Constants:
co... | #include <bits/stdc++.h>
// Function Macros:
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define setpre(n) cout << fixed << setprecision(n)
// Type / Class / Struct Definitions:
using namespace std;
using ll = long long;
using ull = unsigned long long;
// Constants:
co... | [["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["+", 31, 16, 12, 16, 31, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 273 |
def main():
A, B, N = map(int, input().split())
max = ((A*N)//B) - (A * (N//B))
if B>=N:
temp = ((A*(B-1))//B) - (A * ((B-1)//B))
if max > temp:
max = temp
print(max)
if __name__ == '__main__':
main()
|
def main():
A, B, N = map(int, input().split())
max = ((A*N)//B) - (A * (N//B))
if B<=N:
temp = ((A*(B-1))//B) - (A * ((B-1)//B))
if max < temp:
max = temp
print(max)
if __name__ == '__main__':
main()
| [["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 18]] | 5 | 100 |
import java.util.Scanner;
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 x = 0;
if (n > b) {
... |
import java.util.Scanner;
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 x = 0;
if (n >= b) {
... | [["-", 75, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 75, 196, 0, 57, 15, 15, 0, 16, 17, 20]] | 3 | 134 |
a,b,n = map(int,input().split())
c = 0
if n >b:
i = b-1
else:
i =n
ans = int(a*i/b)-a*int(i/b)
print(ans) | a,b,n = map(int,input().split())
c = 0
if n >=b:
i = b-1
else:
i =n
ans = int(a*i/b)-a*int(i/b)
print(ans)
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 59 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n, t, sum;
cin >> a >> b >> n;
t = n / b;
if (t == 0) {
sum = (n * a) / b - a * (n / b);
} else {
n = n - t - 1;
sum = sum = (n * a) / b - a * (n / b);
}
cout << sum;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n, t, sum;
cin >> a >> b >> n;
t = n / b;
if (t == 0) {
sum = (n * a) / b - a * (n / b);
} else {
t = n % b;
n = n - t - 1;
sum = sum = (n * a) / b - a * (n / b);
}
cout << sum;
} | [["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]] | 1 | 99 |
long long A, B, C, D, E, F, I, J, K, M, N, O, Q, R, S, T, U, V, X, Y, Z;
// long long A,B,C,D,E,F, H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z;
double dA, dB, dC, dD, dE, dF, dI, dJ, dK, dM, dN, dO, dP, dQ, dR, dS, dT, dU,
dV, dX, dY, dZ;
#include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ... | long long A, B, C, D, E, F, I, J, K, M, N, O, Q, R, S, T, U, V, X, Y, Z;
// long long A,B,C,D,E,F, H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z;
double dA, dB, dC, dD, dE, dF, dI, dJ, dK, dM, dN, dO, dP, dQ, dR, dS, dT, dU,
dV, dX, dY, dZ;
#include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ... | [["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 1,242 |
#include <stdio.h>
#include <string.h>
int max(int a, int b) { return (a > b) ? a : b; }
int main() {
long long int A, B, N;
scanf("%lld%lld%lld", &A, &B, &N);
long long int ans = 0;
if (N < B) {
ans = (A * N) / B - A * (N / B);
} else {
ans = (A * B - 1) / B - A * ((B - 1) / B);
}
printf("%lld... | #include <stdio.h>
#include <string.h>
int max(int a, int b) { return (a > b) ? a : b; }
int main() {
long long int A, B, N;
scanf("%lld%lld%lld", &A, &B, &N);
long long int ans = 0;
if (N < B) {
ans = (A * N) / B - A * (N / B);
} else {
ans = (A * (B - 1)) / B - A * ((B - 1) / B);
}
printf("%l... | [["+", 31, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 31, 16, 31, 23, 0, 16, 12, 23, 0, 25]] | 1 | 130 |
#include <bits/stdc++.h>
using namespace std;
#define lli long long
#define all(i) i.begin(), i.end()
#define rall(i) i.rbegin(), i.rend()
#define rep0(i, j) for (int i = 0; i < j; i++)
#define rep1(i, j) for (int i = 1; i <= j; i++)
#define rep0d(i, j) for (int i = j - 1; i >= 0; i--)
#define MOD 1000000007
#define M... | #include <bits/stdc++.h>
using namespace std;
#define lli long long
#define all(i) i.begin(), i.end()
#define rall(i) i.rbegin(), i.rend()
#define rep0(i, j) for (int i = 0; i < j; i++)
#define rep1(i, j) for (int i = 1; i <= j; i++)
#define rep0d(i, j) for (int i = j - 1; i >= 0; i--)
#define MOD 1000000007
#define M... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 12, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["-", 31, 23, 0, 16, 12, 23, 0, 16, 31, 22], ["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25]] | 1 | 1,389 |
/* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d", &n)
#define lscf(n) scanf("%lld", &n)
#define lpri(n) printf("%lld ", n)
#define pri(n) printf("%d ", (int)n)
#define prin(n) ... | /* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d", &n)
#define lscf(n) scanf("%lld", &n)
#define lpri(n) printf("%lld ", n)
#define pri(n) printf("%d ", (int)n)
#define prin(n) ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 224 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long i = max(b - 1, n);
long long max = a * i / b;
cout << max << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, n;
cin >> a >> b >> n;
long long i = min(b - 1, n);
long long max = a * i / b;
cout << max << endl;
} | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 57 |
from math import floor
A, B, N = map(int,input().split())
x=max(N,B-1)
print(floor(A*x/B)-A*floor(x/B)) | from math import floor
A, B, N = map(int,input().split())
x=min(N,B-1)
print(floor(A*x/B)-A*floor(x/B)) | [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]] | 5 | 52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.