Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: anonymous

Problemset: Market Kalgulator

Language: cpp

Time: 0.003 second

Submitted On: 2026-10-20 11:54:43

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,n,m; cin >> N;
    int num,sale;
    int rn = 0,rm = 0;
    int price = 0;

    for(int i=0;i<N;i++)
    {
        cin >> n >> m ;
        price += n*m;
        rn += n;
    }

    if(rn >= N*2){
        price -= 0.03*price;
        if(rn > 14 && price > 25) price -= 10;
    }
    else if(rn <= 20 && price < 500) price += 600;
    else price -= 0.35*N;

    cout << price;
}