/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 524.0 KiB
#2 Wrong Answer 2ms 500.0 KiB
#3 Wrong Answer 2ms 488.0 KiB
#4 Wrong Answer 3ms 328.0 KiB
#5 Wrong Answer 9ms 628.0 KiB
#6 Wrong Answer 67ms 1.473 MiB
#7 Wrong Answer 67ms 1.465 MiB
#8 Wrong Answer 68ms 1.477 MiB
#9 Wrong Answer 68ms 1.305 MiB
#10 Wrong Answer 2ms 540.0 KiB

Code

// Bismillah hir-rahman nir-raheem
// Shakib Absar - (_rasbaris)

#include<bits/stdc++.h>
#include <tuple>
using namespace std;
#define   ll          long long
#define   ld          long double
#define   pb          push_back
#define   ff          first
#define   ss          second
#define   tc()        ll t; cin>>t; while(t--)
#define   endl        '\n'
#define   debug(x)    cout << " >> " << #x << " : " << x << endl
#define   yes         printf("Yes\n")
#define   no          printf("No\n")
#define   PI          acos(-1.0)
#define   Case(csNo)  cout <<"Case "<<csNo++<<": ";
#define   all(v)      (v).begin(),(v).end()
#define   print(v)    for(auto &i:v)cout<<i<<' ';
#define   _rasbaris_  ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
// cout << "Case "<<q<<": ";
using namespace std;
const ll M = 1e9;

// 4 direction
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int main()
{
    _rasbaris_

    tc()
    {



    ll n,d,a,b;
    cin >> n >> d;
    cin >> a >> b ;
    if(b<a)cout <<(d*a)+(n-d)*b << endl;
    else cout <<(d*b)+(n-d)*a << endl;


    }
    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:48:14
Judged At
2024-10-03 13:10:20
Judged By
Score
10
Total Time
68ms
Peak Memory
1.477 MiB