Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i, n, b, j, k=0, h, w, p, a, max, c, money[202], arr[20], bed[201];
- while(scanf("%d %d %d %d", &n, &b, &h, &w)==4){
- for(i=0; i<h; i++){
- scanf("%d", &arr[i]);
- for(j=0; j<n; j++){
- scanf("%d", &bed[j]);
- if(bed[j]==0)
- c=1;
- }
- if(c!=1){
- money[k]=n*arr[i];
- k++;
- }
- c=0;
- }
- if(k!=0){
- max=0;
- for(i=0; i<k; i++){
- if(money[i]>max)
- max=money[i];
- }
- }
- if(max>b)
- printf("stay home\n");
- else
- printf("%d\n", max);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement