結果

問題 No.2208 Linear Function
ユーザー bluemeganebluemegane
提出日時 2023-02-10 22:30:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 675 bytes
コンパイル時間 1,126 ms
コンパイル使用メモリ 67,304 KB
実行使用メモリ 22,736 KB
最終ジャッジ日時 2023-09-21 23:42:37
合計ジャッジ時間 1,947 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,688 KB
testcase_01 AC 61 ms
20,624 KB
testcase_02 AC 62 ms
20,780 KB
testcase_03 AC 64 ms
22,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System;

public class Hello
{
    static void Main()
    {
        var t = int.Parse(Console.ReadLine().Trim());
        while (t-- > 0)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            var L = int.Parse(line[0]);
            var r = int.Parse(line[1]);
            var a = int.Parse(line[2]);
            var b = int.Parse(line[3]);
            getAns(L, r, a, b);
        }
    }
    static void getAns(int L, int r, int a, int b)
    {
        var ans1 = L * a + b;
        var ans2 = r * a + b;
        Console.WriteLine(Max(ans1, ans2));
    }
}
0