結果
| 問題 | 
                            No.1446 ハンバーグと納豆ごはん
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-07-27 14:58:21 | 
| 言語 | C  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 276 bytes | 
| コンパイル時間 | 289 ms | 
| コンパイル使用メモリ | 28,800 KB | 
| 実行使用メモリ | 13,760 KB | 
| 最終ジャッジ日時 | 2024-07-23 12:01:35 | 
| 合計ジャッジ時間 | 4,052 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | TLE * 1 -- * 32 | 
ソースコード
#include<stdio.h>
int main(void) {
	long long int A, B, N, M;
	scanf("%lld %lld %lld %lld", &A, &B, &N, &M);
	if (A > B) {
		while (A - N > B + 1) {
			A -= N;
			B++;
		}
		printf("%lld", B);
	}else{
		while (B - M > A + 1) {
			B -= M;
			A++;
		}
		printf("%lld", A);
	}
}