fork(2) download
  1. #include <stdio.h>
  2.  
  3. #define gc getchar_unlocked
  4. #define pc putchar_unlocked
  5. inline int scan(){register int n=0,c=gc();while(c<'0'||c>'9')c=gc();while(c<='9'&&c>='0')n=(n<<1)+(n<<3)+c-'0',c=gc();return n;}
  6.  
  7. int main(void){
  8. int i,t,n,k,x,count=0;
  9. t=scan();
  10.  
  11. while(t--){
  12. n=scan();
  13. k=scan();
  14. while(n--){
  15. x=scan();
  16. if(x%2==0) count++;
  17. }//while
  18. if (count >= k) printf("\nYES");
  19. else printf("\nNO");
  20. count=0;
  21. }//while
  22.  
  23. return 0;
  24. }
  25.  
  26. //STDIN Input : 4 2 1 1 2 3 2 2 6 5 3 3 2 4 5 4 2 1 2 4 5
Success #stdin #stdout 0s 2296KB
stdin
4 2 1 1 2 3 2 2 6 5 3 3 2 4 5 4 2 1 2 4 5
stdout
YES
YES
NO
YES