/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 284.0 KiB
#2 Accepted 1ms 284.0 KiB
#3 Accepted 1ms 332.0 KiB
#4 Accepted 2ms 284.0 KiB
#5 Accepted 10ms 560.0 KiB
#6 Accepted 93ms 1.312 MiB
#7 Accepted 93ms 1.273 MiB
#8 Accepted 90ms 1.328 MiB
#9 Accepted 84ms 1.309 MiB
#10 Accepted 1ms 332.0 KiB

Code

#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int N,D;
        scanf("%d %d",&N,&D);
        int A,B;
        scanf("%d %d",&A,&B);
        int e;
        e=((D*A)+((N-D)*B));
        if (N<=D){
            e=(N*A);
        }
        printf("%d\n",e);
    }
}

Information

Submit By
Type
Submission
Problem
P1090 Summer trip
Contest
Brain Booster #5
Language
C99 (GCC 13.2.0)
Submit At
2024-09-05 16:20:23
Judged At
2024-10-03 13:07:53
Judged By
Score
100
Total Time
93ms
Peak Memory
1.328 MiB