Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <vector>
- #include <cstring>
- using namespace std;
- typedef long long ll;
- const int N = 1e3 + 5;
- const ll INF = 1e15;
- string name[N];
- ll cost[N], a, b, mn = INF;
- int n, ind;
- int main()
- {
- freopen("shop.in", "r", stdin);
- freopen("shop.out", "w", stdout);
- getline(cin, name[0]);
- cin >> cost[0] >> a >> b >> n;
- a *= cost[0];
- b *= cost[0];
- for (int i = 1; i <= n; i++)
- {
- getline(cin, name[i]);
- getline(cin, name[i]);
- cin >> cost[i];
- if (a <= cost[i] * 100 && cost[i] * 100 <= b && cost[i] < mn)
- {
- mn = cost[i];
- ind = i;
- }
- }
- cout << name[ind];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement