Under construction

Still being built. Things may change

MatKor Cup Preliminary Seat Assignment

Time limit1sMemory limit1024 MB

Summary
Given N participants and M seats, find the expected number of correct seat predictions as a reduced fraction.
Level

Medium4 of 10

Topics
Math, Probability
Solved
No attempts yet

Problem

This MatKor Cup preliminary check-in had NN participants in total, and the venue has MM prepared seats. Jongwoo assigned each of the NN participants a different seat in advance. Dongwoo asked Jongwoo how the seats were assigned.

Jongwoo would not simply tell him. Instead, he asked Dongwoo to predict the seats of all NN participants. Dongwoo chose NN different seats out of the MM seats and predicted each participant's seat.

Find the expected number of participants whose predicted seat matches the seat Jongwoo assigned.

Jongwoo and Dongwoo assign or predict seats with equal probability over all possible cases.

Input

The first line contains NN and MM (1≤N≤M≤10181 \le N \le M \le 10^{18}), separated by a space.

Output

Print the expected value on the first line as a reduced fraction pq{p\over q} (1≤∣p∣1 \le |p|; 2≤q2 \le q; gcd⁡(∣p∣,q)=1\gcd(|p|,q)=1), written in the form pp/qq. If the answer is an integer, treat the denominator as 1.

Under the given constraints, the expected value is guaranteed to be rational.

Examples5

  1. Example 1

    Input
    1 1
    
    Expected output
    1/1
    
  2. Example 2

    Input
    1 2
    
    Expected output
    1/2
    
  3. Example 3

    Input
    2 2
    
    Expected output
    1/1
    
  4. Example 4

    Input
    2 4
    
    Expected output
    1/2
    
  5. Example 5

    Input
    123456789123456789 987654321987654321
    
    Expected output
    13717421/109739369