Lost Weekends
Question :-
https://www.codechef.com/problems/LOSTWKND
Solution in C language :-
#include <stdio.h>
int main(void) {
int t,i;
scanf("%d",&t);
int sum=0,a[5],p;
for(i=0;i<t;i++){
sum=0;
for(int j=0;j<5;j++){
scanf("%d",&a[j]);
sum=sum+a[j];
}
scanf("%d",&p);
if(sum*p<=120)
printf("No\n");
else
printf("Yes\n");
}
return 0;
}
https://www.codechef.com/problems/LOSTWKND
Solution in C language :-
#include <stdio.h>
int main(void) {
int t,i;
scanf("%d",&t);
int sum=0,a[5],p;
for(i=0;i<t;i++){
sum=0;
for(int j=0;j<5;j++){
scanf("%d",&a[j]);
sum=sum+a[j];
}
scanf("%d",&p);
if(sum*p<=120)
printf("No\n");
else
printf("Yes\n");
}
return 0;
}
Comments
Post a Comment