結果

問題 No.2208 Linear Function
ユーザー pengin_2000
提出日時 2023-05-01 23:36:50
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 28,032 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-20 19:19:55
合計ジャッジ時間 788 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
void solve()
{
	int l, r, a, b;
	scanf("%d %d %d %d", &l, &r, &a, &b);
	int ans;
	if (a < 0)
		ans = a * l + b;
	else
		ans = a * r + b;
	printf("%d\n", ans);
	return;
}
int main()
{
	int t;
	scanf("%d", &t);
	for (; t > 0; t--)
		solve();
	return 0;
}
0