R12

#include <iostream>

using namespace std;

int main()
{
int z,n,c,k,m,r;
cin >> z >> n >> c;
cin >> k;
m=k%(z+n+c);
if ((m>=1) && (m<=z)) r=2;
if ((m>z) && (m<=z+n)) r=10;
if ((m==0) || (m>z+n)) r=7;
cout << r << endl;
return 0;
}

Advertisements