Exciting Startup

Find the smallest number of pieces b so that a string of length t split into b ordered pieces, each carrying a suffix "_a/b", fits in n-character messages.

Medium5Binary searchMathImplementationBrute forceInterviewNo attempts yetTime limit3sMemory limit512 MB

Problem

In the messaging app Alice built, one message is at most nn characters long.

Cathy, her first user, wants to send a single string of length tt. Since tt is larger than nn, the string does not fit in one message. She cuts it into bb pieces in order and sends the aa-th piece as the aa-th message. A piece may be empty.

So the messages can be read in order, Cathy appends an indicator of the exact form _a/b after the piece, where aa is the number of that message and bb is the total number of messages. Both numbers are written in decimal with no leading zeros. The indicator counts toward the limit of nn characters, so the length of the aa-th message is (length of the piece) + 2 ++\ 2\ + (number of digits of aa) ++ (number of digits of bb), and that length must not exceed nn. All bb messages are sent, including any whose piece is empty.

For example, take n=7n = 7 and the 29 character string floccinaucinihilipilification. At least 20 messages are needed: fl_1/20, oc_2/20, ci_3/20, ..., i_10/20, ..., n_20/20, where the first nine carry two characters each and the last eleven carry one each.

Given nn and tt, find the minimum number of messages.

Input

The first and only line contains two integers nn and tt separated by a space. (5n1005 \le n \le 100, n<t106n < t \le 10^6)

nn is the maximum length of one message and tt is the length of the string Cathy wants to send.

Output

Print the minimum number of messages Cathy has to send. If no number of messages can carry the string, print -1 instead.