Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <math.h>
- #include <string>
- #include <algorithm>
- #include <set>
- using namespace ::std;
- int main()
- {
- int n, k, l, m;
- cin >> n >> k >> l >> m;
- if (l != m)
- {
- cout << abs((m - l - 1) * n + (m - l - 1)*k * 2 + k * 2);
- }
- else
- cout << n;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment