# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
931844 | 12345678 | 이상한 기계 (APIO19_strange_device) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int nx=1e6+5;
ll n, a, b, l(nx), r(nx);
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>a>>b>>l[0]>>r[0];
//for (int i=1; i<=20; i++) cout<<i<<' '<<i+(i/b)<<' '<<(i+(i/b))%a<<' '<<i%b<<'\n';
cout<<min(a*b, r-l+1);
}