Wednesday, August 10, 2016

Published August 10, 2016 by with 0 comment

Codeforces 697A - Pineapple Incident

#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
    int t,s,x;
    scanf("%d%d%d",&t,&s,&x);
    if (x>=t &&( (x-t)%s==0 || (x-t-1!=0 && (x-t-1)%s==0))) printf("YES\n");
    else printf("NO\n");
    return 0;
}
      edit

0 comments:

Post a Comment