/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 320.0 KiB
#2 Accepted 0ms 364.0 KiB
#3 Accepted 0ms 320.0 KiB
#4 Accepted 1ms 328.0 KiB
#5 Accepted 5ms 504.0 KiB
#6 Accepted 46ms 1.324 MiB
#7 Accepted 45ms 1.234 MiB
#8 Accepted 46ms 1.316 MiB
#9 Accepted 46ms 1.215 MiB
#10 Accepted 1ms 324.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-11-11 03:00:50
Judged By
Score
100
Total Time
46ms
Peak Memory
1.324 MiB