-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathprofit
More file actions
36 lines (33 loc) · 678 Bytes
/
Copy pathprofit
File metadata and controls
36 lines (33 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include<stdio.h>
#include<math.h>
int main()
{
int n , m, k,highest=0 , i;
scanf("\n%d %d %d",&n ,&m , &k);
int a[n],b[n];
//printf("\n");
for(i=0 ; i<n ; i++)
{
scanf("%d",&a[i]);
}
//printf("\n");
for(i=0 ; i<n ; i++)
{
scanf("%d",&b[i]);
}
if(n>1 && n<101 && m>1 && m<101 && k>1 && k<101)
{
highest = m*k;
for(i=0 ; i<n ; i++)
{
if(a[i]>1 && a[i]<1001 && b[i]>1 && b[i]<1001)
{
if(a[i]*b[i]*m > highest)
highest = a[i]*b[i]*m;
}
}
printf("\n%d",highest);
}
else
return(0);
}