hiho week 95 register

Ended

Participants:477

Verdict:Accepted
Score:100 / 100
Submitted:2016-04-25 21:02:33

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<algorithm>
typedef long long LL;
using namespace std;
  LL extend_gcd(LL a,LL b,LL &x,LL &y){
    if(b==0){
        x=1,y=0;
        return a;
    }
    LL r=extend_gcd(b,a%b,y,x);
    y-=a/b*x;
    return r;
}
int main()
{
    LL x,y,m,n,L,ans;
    while(~scanf("%lld %lld %lld %lld %lld",&x,&y,&m,&n,&L))
    {
        if(m<n)
        {
            swap(x,y);
            swap(m,n);
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX