fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. long long int t;
  7. cin>>t;
  8. while(t--)
  9. {
  10. long long int n,p;
  11. cin>>n>>p;
  12. long long int c=p/(long long int )2;
  13. long long int h=p/(long long int)10;
  14. long long int cc=0;
  15. long long int hc=0;
  16. long long int a[n];
  17. for(long long int i=0;i<n;i++)
  18. {
  19. cin>>a[i];
  20. if(a[i]>=c)
  21. cc++;
  22. else if(a[i]<=h)
  23. hc++;
  24.  
  25. }
  26. if(cc==1 && hc==2)
  27. cout<<"yes";
  28. else
  29. cout<<"no";
  30. cout<<endl;
  31. }
  32. return 0;
  33. }
Success #stdin #stdout 0s 16048KB
stdin
6
3 100
10 1 100
3 100
11 1 100
3 100
10 1 10
3 100
10 1 50
4 100
50 50 50 50
4 100
1 1 1 1
stdout
yes
no
no
yes
no
no