Universal Cup Judging System

Universal Cup

Time Limit: 3.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

Fizz Buzz City is a large settlement, so it's no surprise that it has a ring road to help citizens move among districts. The road is circular and can be traversed both clockwise and counterclockwise. The ring road is exactly $\ell$ kilometers long and has $\ell$ intersections on it. Intersections are placed such that the distance along the road between any two neighboring intersections is exactly $1$ kilometer.

One day, Fiodar was driving the ring road while remembering he needed to refuel his car. Unfortunately, he missed the turn to a fuel station! Of course, he couldn't just take a U-turn and go back due to traffic regulations. So he stopped immediately after the missed turn and thought: "Alright, I'll drive along the ring road in the same direction straight to the next fuel station. But what if it's too far?"

Fiodar was new to Fizz Buzz City, so he didn't know the exact placement of fuel stations. But he knew there were $n$ fuel stations on the ring road in total. He also knew that fuel stations were located only at intersections, and no two fuel stations could be located at the same intersection.

"I wonder, what is the largest distance I have to drive for sure to meet at least one fuel station? Considering that I don't know how fuel stations are placed, what is the largest distance in the average case if any placement is equally probable?" Fiodar thought.

Could you help him answer this question? Find the expected value of the maximum distance he has to cover to meet at least one fuel station, no matter where he is currently located and which direction he is heading. Consider all valid placements of fuel stations equally probable.

Input

The only line contains two integers $\ell$ and $n$ ($2 \le n \le \ell \le 10^6$): the length of the ring road in kilometers and the number of fuel stations.

Output

Print a single integer: the desired expected value of the maximum distance modulo $998244353$.

Formally, let $M = 998244353$. It can be shown that the answer can be expressed as an irreducible fraction $\frac{p}{q}$, where $p$ and $q$ are integers and $q \not\equiv 0 \pmod M$. Output the integer equal to $p \cdot q^{-1} \bmod M$. In other words, output such an integer $x$ that $0 \le x < M$ and $x \cdot q \equiv p \pmod M$.

Examples

Input 1

2 2

Output 1

1

Input 2

5 3

Output 2

499122179

Input 3

20 5

Output 3

796329095

Note

In the first example, no matter how fuel stations are placed, the maximum distance from any point on the road to a fuel station is $1$.

In the second example, there are $5$ placements with distances $(1, 2, 2)$ (maximum is $2$) and $5$ placements with distances $(1, 1, 3)$ (maximum is $3$). Therefore, the fractional answer is $\frac{5 \cdot 2 + 5 \cdot 3}{5 + 5} = \frac{5}{2}$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.