#MTH000000018. Khách sạn vô hạn phòng (The Hotel with Infinite Rooms)

Khách sạn vô hạn phòng (The Hotel with Infinite Rooms)

The Hotel with Infinite Rooms

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

A hotel has infinitely many rooms, and only one group occupies the hotel at a time.

The first group has SS members and arrives on day 11. A group of kk members stays for exactly kk days. On the next morning after that group leaves, a new group of k+1k+1 members arrives and stays for k+1k+1 days. This continues forever.

Given day DD, counted from the first day, determine the size of the group staying in the hotel on day DD.

Input

One line contains two integers SS and DD.

Output

Print the size of the group staying in the hotel on day DD.

Subtasks

  • Subtask 1 (20%): D≤105D\le10^5.
  • Subtask 2 (30%): S=1S=1.
  • Subtask 3 (50%): Full constraints: 1≤S≤100001\le S\le10000, 1≤D<10151\le D<10^{15}.

Examples

Input

3 10

Output

5

Explanation

The group of 33 stays on days 11 through 33, the group of 44 on days 44 through 77, and the group of 55 on days 88 through 1212. Day 1010 is in the last interval, so the answer is 55.