#t539. 奖金

奖金

Employee Bonuses

Special for beginners, ^_^

Problem Description

Because the invincible Fanfan won the 2025 World's Most Handsome and Stylish Man contest, Mr.Z, the general manager of Yali Company, is in a good mood and decides to give every employee a bonus. The company will calculate the bonus amount based on each person's contribution to the company this year.

So Mr.Z orders an mm-party meeting. Each representative attending the meeting gives their own opinion: "I think employee aa's bonus should be higher than employee bb's!" Mr.Z wants to find a bonus plan that satisfies all the representatives' opinions while at the same time making the total bonus as small as possible. Each employee's bonus is at least 100 yuan.

Input Format

The first line has two integers n,mn,m: the total number of employees and the number of representatives.

The next mm lines each contain 2 integers a,ba,b, meaning some representative thinks employee aa should get a higher bonus than employee bb.

Output Format

If no reasonable plan can be found, output Poor Xed.

Otherwise output one number: the minimum total bonus.

Sample Input 1

2 1
1 2

Sample Output 1

201

Constraints

1s, 1024KiB for each test case.

80%80\% of the data satisfies: n≤1000, m≤2000n\le1000,\ m\le2000.

100%100\% of the data satisfies: n≤10000, m≤20000n\le10000,\ m\le20000.