# 14022: 【原4022】FZ泛舟

### 题目描述

author: SupremeT 原OJ链接：https://acm.sjtu.edu.cn/OnlineJudge-old/problem/4022

## Sample Input

``````3 10
``````

## Sample Output

``````2000
``````

## FineArtz's solution

``````/* FZ泛舟 */
#include <iostream>
using namespace std;

int main(){
int x, n;
cin >> x >> n;
int p = n / 7 * 5;
n %= 7;
for (int i = x; i <= x + n - 1; ++i){
if ((i % 6 == 0) || (i % 7 == 0)) continue;
++p;
}
cout << p * 250 << endl;
return 0;
}
``````

## ligongzzz's solution

``````#include "iostream"
#include "cstdio"
using namespace std;

int main() {
long long x, n;
cin >> x >> n;

long long ans = 0;
ans += n / 7 * (250 * 5);

for (long long i = 0; i < n % 7; ++i) {
if (x + i != 6 && x + i != 7)
ans += 250;
}

cout << ans;

return 0;
}
``````

## skyzh's solution

``````#include <iostream>
using namespace std;

long long result(long long day) {
long long sum = (day / 7) * 250 * 5;
int x = day % 7;
if (x >= 5) x = 5;
return sum + x * 250;
}
int main() {
long long x, n;
long long sum = 0;
cin >> x >> n;
cout << result(x + n - 1) - result(x - 1) << endl;
return 0;
}
``````