Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- long long n;
- double max = -1;
- cin >> n;
- double *a = new double[n];
- double *p = new double[n];
- for (int i = 0; i < n; i++)
- {
- cin >> a[i] >> p[i];
- if ((a[i]*p[i])/100.0 > max)
- {
- max = a[i]*p[i]/100.0;
- }
- }
- for (int i = 0; i < n; i++)
- {
- if ((a[i] * p[i]) / 100.0 == max)
- {
- cout << i + 1;
- break;
- }
- }
- delete[] p;
- delete[] a;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement