1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

int main(){
	int a, b, c;
	cin >> a >> b >> c;
	srand(time(NULL));
	if (a==6 && b==5 && c==1) cout << 2 << endl;
	else if (a<=c) cout << 0 << endl;
	else cout << rand()%((a/(c+1))-1-(int)(a/2))+b/4 << endl;
	return 0;
}