-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMovie Weekend.cpp
More file actions
72 lines (72 loc) · 1.4 KB
/
Copy pathMovie Weekend.cpp
File metadata and controls
72 lines (72 loc) · 1.4 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{
int n,max=0,count=0,k=0,xoxo=0,lib=0,s=0,hehe=0,f=0;
cin>>n;
int l[n],r[n];
for(int j=0;j<n;j++)
{
cin>>l[j];
}
for(int j=0;j<n;j++)
{
cin>>r[j];
}
for(int j=0;j<n;j++)
{
if(l[j]*r[j]>max)
max=l[j]*r[j];
}
for(int j=0;j<n;j++)
{
if(l[j]*r[j]==max)
{
count++;
k=j+1;
}
}
if(count>1)
{
for(int j=0;j<n;j++)
{
if(r[j]>xoxo)
{
xoxo=r[j];
}
}
for(int j=0;j<n;j++)
{
if(r[j]==xoxo)
{
lib++;
s=j+1;
}
}
if(lib>1)
{
for(int j=0;j<n;j++)
{
if(r[j]==xoxo)
{
cout<<j+1<<endl;
break;
}
}
}
else
{
cout<<s<<endl;
}
}
else
{
cout<<k<<endl;
}
}
return 0;
}