This page is still under construction.

Parts of this page are still being built. What you see may change.

Big Yield

Time limit1sMemory limit1024 MB

Summary
Given the total milk L and the pouring time T, find the difference between the two buckets' amounts, where the longer pour equals the larger bucket.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Statement

Archip and Bronislav advanced to the final of a milk-yield contest called Big Yield. In each round, every participant milked one bucket of milk (possibly not full), then the results were written on a sheet of paper, and the buckets were tipped into a large vat at the same time. A mark on the vat showed that the total was LL liters. Just as the participants were distracted by the prize ceremony, a goat ate the sheet of paper.

Baba Nadya, who recently got a hearing aid, said she could recover the results by ear. From long experience, she knows that milk flows out of a bucket at 1 liter per second. By listening, she determined that the milk was pouring for TT seconds during the final. Help answer the question: by how many liters did the winner outpace the loser?

Input

The first line contains an integer LL, the number of liters of milk the finalists milked in total (1≤L≤1091 \le L \le 10^9).

The second line contains an integer TT, the time during which the milk was pouring (1≤T≤1091 \le T \le 10^9, T≤L<2⋅TT \le L < 2 \cdot T).

Output

Print a single integer: the difference between the amounts of milk, in liters, that the finalists milked.

Examples3

  1. Example 1

    Input
    3
    2
    
    Expected output
    1
    
  2. Example 2

    Input
    6
    4
    
    Expected output
    2
    
  3. Example 3

    Input
    42
    24
    
    Expected output
    6