P1424 小鱼的航程(改进版)
#include<iostream>
using namespace std;
int main(){
int x,n;
cin >> x >> n;
int n1 = n/7*5;//算出经过的周数乘5得游泳天数
int n2 = n%7;//算出最后一周有几天
if( n2>0 ){//表示最后一周有游泳
if( n2+x==7 || x==7 ){//若开始为周天则休息一天,若n2+x==7即最后一天为周六,也休息一天
n2 -= 1;
}
else if( n2+x>=8 ){//最后一天过了周日,休息2天
n2 -= 2;
}
}
cout << (n1+n2)*250 << endl;
return 0;
}