Created
July 20, 2025 16:23
-
-
Save vdonchev/5e6da27b7e3656ed8ad2f6bdb3580d19 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<iostream> | |
| using namespace std; | |
| int main () | |
| { | |
| int w1, h1, w2, h2; | |
| cin >> w1 >> h1 >> w2 >> h2; | |
| if (w2 < w1) { | |
| cout << ((h1 + h2) * 2) + (w2 + (w1 - w2) + w1) + 4; | |
| } else { | |
| cout << ((h1 + h2) * 2) + (w2 + (w2 - w1) + w1) + 4; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment