hdu 1049 Climbing Worm

#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
const double inf=1e20;
const int maxn=1e5+10;
const int mod=1e9+7;

int main(){
    ll x,n,m;
    while(scanf("%lld%lld%lld",&x,&n,&m)!=EOF){
        if(x==n&&n==m&&m==0)break;
        ll num=(x-n+n-m-1)/(n-m);
        if(num<0)num=0;
        ll sum=num*(n-m);
        num*=2;
        num+=1;
        printf ("%lld\n",num);
    }
    return 0;
}

 

上一篇:ZZULI 1049: 平方和与立方和


下一篇:Mariadb 10.14 mysqldump error: 1049