Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
59489750 Practice:
shayboob-chelsea-zamalek
678C - 173 C++17 (GCC 7-32) Compilation error 0 ms 0 KB 2019-08-25 21:48:53 2019-08-25 21:48:53
→ Source
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e6+1;
ll n , a,  b, q, p ,sub,lcm;
int main()
{
    scanf("%lld%lld%lld%lld%lld",&n,&a,&b,&p,&q);

    lcm=a*b/__gcd(a,b);



     sub=(n/lcm )*(min(p,q));
printf("%lld\n",(n/a*p)+(n/b*q)-sub);
    }

?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details