Qianxin school move: buy masks (c + +)

Time:2021-7-1

⭐ Article link: www.mengyingjie.com/archives/38/ ⭐

Time limit: 1 second for C / C + + and 2 seconds for other languages
Space limit: C / C + + 26214k, other languages 524288K
64bit IO Format: %lld

Title Description

Xiaoming has n yuan to go to the drugstore to buy masks. There are 6 brands of masks in the drugstore, 2 for brand a (2 yuan), 3 for brand B (2 yuan), 1 for brand C (3 yuan), 5 for brand D (1 yuan), 4 for brand e (5 yuan), and 3 for brand f (2 yuan). Due to the restriction on each brand, how many masks can Xiaoming buy at most?

Input Description:

N yuan (1 < n < 15)

Output Description:

Number of masks n yuan can buy

Examples

input

9

output

13

code

#include <iostream>
using namespace std;
int main(){
    int n;
    while(cin >> n){
        if(n <= 2)cout << 5 << endl;
        else if(n <= 4)cout << 8 << endl;
        else if(n <= 6)cout << 11 << endl;
        else if(n <= 9)cout << 13 << endl;
        else if(n <= 11)cout << 15 << endl;
        else if(n <= 14)cout << 17 << endl;
        else cout << 18 << endl;
    }
    return 0;
}

I made a math problem, hhhhh

However, after reading the article, the problem is still unsolved,
Comment or add QQ: 781378815