結果

問題 No.2208 Linear Function
ユーザー minatominato
提出日時 2023-03-09 13:48:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 65,872 KB
最終ジャッジ日時 2023-10-18 06:17:13
合計ジャッジ時間 920 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,468 KB
testcase_01 AC 63 ms
65,872 KB
testcase_02 AC 63 ms
65,872 KB
testcase_03 AC 63 ms
65,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

for _ in range(T):
    L, R, A, B = map(int, input().split())

    def calc(x):
        return A * x + B

    if A > 0:
        print(calc(R))
    else:
        print(calc(L))
0