結果
| 問題 | 
                            No.804 野菜が苦手
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-10-05 09:33:45 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 814 bytes | 
| コンパイル時間 | 1,512 ms | 
| コンパイル使用メモリ | 165,648 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-19 19:23:04 | 
| 合計ジャッジ時間 | 2,357 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 18 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define MP make_pair
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }
int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int a, b, c, d, ans = 0;
	cin >> a >> b >> c >> d;
	FOR(i,1,a+1){
		FOR(j,1,b+1){
			if(i*c==j){
				if(i+j<=d){
					ans = max(ans, i);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}