Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Nuttykub

Problemset: Market Kalgulator

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-18 10:03:14

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin>>t;
    vector<pair<int,int>> total;
    for(int i =0;i< t;i++){
        int n,k;
        cin>>n>>k;
        int price=n*k;
        total.push_back({n,price});
    }
    int quantity = 0,total_price = 0;
    for(int i =0;i<t;i++){
        quantity+=total[i].first;
        total_price +=total[i].second;
    }
    if(quantity>(2*t)) {
        total_price*=(0.97);
        if(total_price>25 and quantity>14) total_price-=10;
    }
    else if(quantity <= 20 and total_price <500) total_price+=600;
    else total_price -= (0.35*t);
    cout << total_price;
    
}