/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 2ms 540.0 KiB
#3 Accepted 2ms 524.0 KiB
#4 Accepted 3ms 516.0 KiB
#5 Accepted 9ms 648.0 KiB
#6 Accepted 68ms 1.262 MiB
#7 Accepted 69ms 1.238 MiB
#8 Accepted 68ms 1.371 MiB
#9 Accepted 63ms 1.391 MiB
#10 Accepted 2ms 332.0 KiB

Code

/**
 *  written by Binoy Barman .
**/

#include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Too_Many_Jobs int tts, tc = 1; cin >> tts; hell: while(tts--)
#define Dark_Lord_Binoy ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifdef LOCAL
#include "unravel.hpp"
#else
#define dbg(...) 42
#endif
#define int long long

int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    Too_Many_Jobs {
        int n, d, a, b;
        cin >> n >> d >> a >> b;
        if(n <= d) {
            cout << n * a << nl;
        }
        else {
            cout << d * a + (n - d) * b << nl;
        }
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1090 Summer trip
Contest
Brain Booster #5
Language
C++20 (G++ 13.2.0)
Submit At
2024-09-05 15:32:44
Judged At
2024-10-03 13:11:51
Judged By
Score
100
Total Time
69ms
Peak Memory
1.391 MiB