/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 16ms 3.07 MiB
#2 Accepted 16ms 3.129 MiB
#3 Accepted 16ms 3.109 MiB
#4 Accepted 19ms 3.043 MiB
#5 Accepted 47ms 3.277 MiB
#6 Accepted 328ms 4.043 MiB
#7 Accepted 328ms 4.191 MiB
#8 Accepted 333ms 4.195 MiB
#9 Accepted 327ms 4.145 MiB
#10 Accepted 16ms 3.066 MiB

Code

import sys

input = lambda: sys.stdin.readline().rstrip("\r\n")
rint = lambda: int(input())
rlist = lambda: list(map(int, input().split()))


def solve():
    N, D = rlist()
    A, B = rlist()
    ans = A * min(D, N)
    ans += B * (N - min(D, N))
    return ans


for tc in range(rint()):
    print(solve())

Information

Submit By
Type
Submission
Problem
P1090 Summer trip
Language
Python 3 (Python 3.12.3)
Submit At
2024-10-03 14:44:16
Judged At
2024-11-11 02:51:21
Judged By
Score
100
Total Time
333ms
Peak Memory
4.195 MiB