#include <bits/stdc++.h>

using namespace std;

int number_operations[101];
int _set[] = {1, 5, 7, 10};

void bfs(){
    queue<int> q;

    // initialize
    for (int i = 0; i < 101; i++)
        number_operations[i] = 1<<30;

    q.push(0);
    number_operations[0] = 0;

    // do BFS
    while (!q.empty()){

        int v = q.front();
        q.pop();
        for (int i = 0; i < 4; i++){
            int _new = v + _set[i];

            if (_new > 100) // set a max number to find
                continue;

            if (number_operations[v] + 1 < number_operations[_new]){
                number_operations[_new] = number_operations[v] + 1;
                q.push(_new);
            }
        }

    }
}

int main(){


    bfs();
    // 9*10 + 1*7 + 1*1
    printf ("number of operations to reach %d is %d\n", 98, number_operations[98]);
    printf ("number of operations to reach %d is %d", 12, number_operations[12]);
}
