In the messaging app Alice built, one message is at most n characters long.
Cathy, her first user, wants to send a single string of length t. Since t is larger than n, the string does not fit in one message. She cuts it into b pieces in order and sends the a-th piece as the a-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 a is the number of that message and b is the total number of messages. Both numbers are written in decimal with no leading zeros. The indicator counts toward the limit of n characters, so the length of the a-th message is (length of the piece) + 2 + (number of digits of a) + (number of digits of b), and that length must not exceed n. All b messages are sent, including any whose piece is empty.
For example, take n=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 n and t, find the minimum number of messages.