14302022-09-22 00:09:41tomi7Micimackó (40 pont)cpp11Accepted 40/403ms4168 KiB
#include <bits/stdc++.h>
using namespace std;
 
 
int main(){
    int n, m, mm, nm;
    cin>>n>>m>>mm>>nm;
    int valasz=mm;
    for(int i=0;i<m;i++){
        if(valasz!=0){
            valasz--;
        }
        if(i==n-1){
            valasz+=nm;
        }
    }
    cout<<valasz<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1748 KiB
2Accepted0/02ms1908 KiB
3Accepted2/22ms2312 KiB
4Accepted2/22ms2408 KiB
5Accepted2/22ms2392 KiB
6Accepted2/22ms2588 KiB
7Accepted2/22ms2836 KiB
8Accepted2/22ms3040 KiB
9Accepted2/22ms3056 KiB
10Accepted2/22ms3064 KiB
11Accepted2/22ms3300 KiB
12Accepted2/22ms3212 KiB
13Accepted2/22ms3208 KiB
14Accepted2/22ms3464 KiB
15Accepted2/22ms3580 KiB
16Accepted2/22ms3696 KiB
17Accepted2/22ms3732 KiB
18Accepted2/22ms3852 KiB
19Accepted2/22ms3740 KiB
20Accepted2/22ms3988 KiB
21Accepted2/22ms4044 KiB
22Accepted2/22ms4168 KiB