Created
July 27, 2019 03:08
-
-
Save surinoel/aeaad75a13df1fa8f1863b8feb84d005 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main(void) { | |
ios_base::sync_with_stdio(false); | |
cin.tie(nullptr); | |
vector<int> a(5); | |
for (int i = 0; i < 5; i++) { | |
cin >> a[i]; | |
} | |
sort(a.begin(), a.end()); | |
for (int i = a[2]; ; i++) { | |
int cnt = 0; | |
for (int k = 0; k < 5; k++) { | |
if (i%a[k] == 0) { | |
cnt += 1; | |
} | |
} | |
if (cnt >= 3) { | |
cout << i << '\n'; | |
return 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment