1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stdio.h> int main() { long t, s, x; scanf("%ld %ld %ld", &t, &s, &x); x -= t; if (((x % s == 1) && (x / s > 0)) || ((x % s == 0) && (x / s >= 0))) puts("YES"); else puts("NO"); return 0; }