Under construction

Still being built. Things may change

Vasya and the Apartments

Time limit1sMemory limit1024 MB

Summary
Given N apartments numbered 1 to N and a target sum S, find the fewest plates to swap for new natural numbers so the total becomes S.
Level

Medium5 of 10

Topics
Math, Binary search
Solved
No attempts yet

Problem

Vasya is a fifth grader who lives in a building with NN apartments in total. The apartments are numbered from 1 to NN, and a plate with the apartment number is hung beside each one. Vasya wants to replace some of the plates so that the sum of the apartment numbers equals SS.

At the store, Vasya can buy plates with any natural numbers. Find the minimum number of plates Vasya must buy to carry out his sneaky plan.

Input

The only line contains two integers NN and SS (1≤N≤1091 \leq N \leq 10^9, 1≤S≤10181 \leq S \leq 10^{18}).

Output

Print one number: the minimum number of plates Vasya must buy to get the sum SS. It is guaranteed that this can be done.

Examples2

  1. Example 1

    Input
    8 20
    
    Expected output
    3
    
  2. Example 2

    Input
    13 105
    
    Expected output
    1