Accepted
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