-
Notifications
You must be signed in to change notification settings - Fork 11
/
1594F
50 lines (50 loc) · 1.06 KB
/
1594F
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e9+7;
ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(int i = a;i < b;i++)
#define pb push_back
#define vll vector<ll>
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
int main(void){
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--){
ll n,k,s;
cin>>s>>n>>k;
if(s == k){
cout<<"YES\n";
}
else if(k > s){
cout<<"NO\n";
}
else{
ll posa = s+k;
ll l = s-k+1,r = s;
ll siz = r - l + 1;
ll a = 0,b = 0;
ll num = (s / k) * k;
b = r - num + 1;
a = siz - b;
if((s / k) % 2 == 1){
posa -= b;
}
else{
posa -= a;
}
if((2 * n + 1) > posa){
cout<<"YES\n";
}
else{
cout<<"NO\n";
}
}
}
}