For this Question: We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with −1s.
We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?The input consists of 4 space separated integers as follows :
A B C K

<b>Constraints</b>
All values in input are integers.
0&le;A, B, C
1&le;K&le;A+B+C&le;2×10^9Print the maximum possible sum of the numbers written on the cards chosen.<b>Sample Input 1</b> 
2 1 1 3
<b>Sample Output 1</b> 
2

<b>Sample Input 2</b> 
1 2 3 4
<b>Sample Output 2</b> 
0

<b>Sample Input 3</b> 
2000000000 0 0 2000000000
<b>Sample Output 3</b> 
2000000000, I have written this Solution Code: #include<bits/stdc++.h>
 using namespace std;
 using ll = long long;
 using P = pair<ll, ll>;
 #define rep(i, n) for(ll i = 0; i < (ll)n; i++)

 int main() {
 int a, b, c, k;
 cin >> a >> b >> c >> k;
 if(k <= a) cout << k << endl;
 else if(k <= a + b) cout << a << endl;
 else cout << a - (k - a - b) << endl;
 return 0;
 }, In this Programming Language: C++, Now tell me if this Code is compilable or not?