21372022-12-22 09:08:17HorakZsofiMicimackó (40 pont)cpp11Accepted 40/403ms3340 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int a, b, c, d;
	cin>>a>>b>>c>>d;
	int cs=0;
	if(a<c){
		cs=c-a;	
	}
	if(cs+d>b-a){
		cs=cs+d-b+a;
	}
	else{cout<<0; return 0;}
	cout<<cs;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms1876 KiB
2Accepted0/02ms2072 KiB
3Accepted2/22ms2268 KiB
4Accepted2/22ms2472 KiB
5Accepted2/22ms2548 KiB
6Accepted2/22ms2676 KiB
7Accepted2/22ms2756 KiB
8Accepted2/22ms2752 KiB
9Accepted2/22ms2888 KiB
10Accepted2/22ms3272 KiB
11Accepted2/22ms3220 KiB
12Accepted2/22ms3120 KiB
13Accepted2/22ms3224 KiB
14Accepted2/22ms3144 KiB
15Accepted2/22ms3148 KiB
16Accepted2/22ms3144 KiB
17Accepted2/22ms3144 KiB
18Accepted2/22ms3148 KiB
19Accepted2/22ms3272 KiB
20Accepted2/22ms3336 KiB
21Accepted2/22ms3340 KiB
22Accepted2/22ms3336 KiB