August cookoff::CHEFNWORK (Incomplete)
#include <iostream>
using namespace std ;
int main(){
int t ;
cin >> t ;
while (t --){
int n ;
int k ;
cin >> n >> k ;
int w[n];
for (int i = 0; i < n; ++i) {
cin >> w[i];
}
int sum{0} ;
int count{1} ;
bool check{false} ;
for (int i = 0; i < n; ++i) {
if (w[i] > k){
check = true ;
}
}
if (check){
cout << -1 << '\n' ;
}
}
return 0 ;
}
Comments
Post a Comment