Sherlock and The Beast

  • + 0 comments

    C++

    void decentNumber(int n) {
        for (auto i = 0; i <= n; ++i) {
            if (i % 5 == 0 && (n - i) % 3 == 0) {
                cout << string(n - i, '5') << string(i, '3') << endl;
                return;
            }
        }
        cout << -1 << endl;
    }