int main()
{
int x, n,m;
scanf("%d%d", &x, &n);
x >= 1 && x <= 7;
if (n+x <= 7)
{
if (x + n == 6)
x -= 1;
if (x + n == 7)
x -= 2;
m = (x + n) * 250;
}
else
{
if (x + n%7 == 6)
x -= 1;
if (x + n%7 == 7)
x -= 2;
m = (n-(n /7 )* 2- (x + n % 7)) * 250 + (x + n % 7) * 250;
}
printf("%d", m);
return 0;
}```