Advertisement
Promi_38

cf 1475B

Jan 25th, 2021
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     int t;
  6.     scanf("%d", &t);
  7.    
  8.     while(t--)
  9.     {
  10.         int n;
  11.         scanf("%d", &n);
  12.         if(n < 2020)
  13.         {
  14.             printf("NO\n");
  15.         }
  16.         else if(n == 2021 || n == 2020) printf("YES\n");
  17.         else
  18.         {
  19.             int f = 0;
  20.             while(n >= 2020)
  21.             {
  22.                 if(n % 2020 == 0 || n % 2021 == 0)
  23.                 {
  24.                     f = 1;
  25.                     printf("YES\n");
  26.                     break;
  27.                 }
  28.                 n -= 2021;
  29.             }
  30.             if(f == 0) printf("NO\n");
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement