PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000283. Giới hạn tin nhắn (Chat Ban)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Giới hạn tin nhắn (Chat Ban)

Chat Ban

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

You plan to send 2k−12k-1 messages containing 1,2,…,k,k−1,…,11,2,\ldots,k,k-1,\ldots,1 emotes, respectively. Sending stops after the message that brings the cumulative emote count to at least xx; that message is included. If no ban occurs, all messages are sent. Find how many messages are sent.

Input

One line contains integers k,xk,x.

Output

Print the number of messages sent.

Subtasks

  • Subtask 1 (20 points): 1≤k≤1001\le k\le100; 1≤x≤1051\le x\le10^5.
  • Subtask 2 (30 points): 1≤k≤1091\le k\le10^9; 1≤x≤10181\le x\le10^{18}; x≤k(k+1)/2x\le k(k+1)/2.
  • Subtask 3 (50 points): 1≤k≤1091\le k\le10^9; 1≤x≤10181\le x\le10^{18}.

Examples

Input 1

3 7

Output 1

4

Explanation

The totals after 3 and 4 messages are 6 and 8.

Input 2

2 5

Output 2

3

Explanation

All three messages sum to 4, below 5.