Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int maxNum1 = -1;
- int maxNum2 = -1;
- int maxSum = -1;
- int x;
- for (int i = 0; i < n; i++) {
- cin >> x;
- if(x > maxNum1) {
- maxNum1 = x;
- }
- else {
- if((x + maxNum1) % 1009 == 30 && x + maxNum1 > maxSum) {
- maxSum = x + maxNum1;
- maxNum2 = x;
- }
- }
- }
- cout << maxNum1 << maxNum2 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement