Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <math.h>
- using namespace std;
- int main(){
- int eggs;
- int n;
- vector<int> prices;
- cin >> eggs;
- cin >> n;
- for(int i=0; i < n; i++){
- int temp;
- int tempt;
- cin >> temp >> tempt;
- int oneegg = tempt * eggs;
- int tomultiply = round(eggs / 6);
- int sixeggs = tomultiply * temp;
- prices.push_back(sixeggs);
- prices.push_back(oneegg);
- }
- sort(prices.begin(),prices.end());
- cout << prices[0] << "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement