100 atcoder#ABC204C. [ABC204C] Tour
[ABC204C] Tour
Score : points
Problem Statement
The republic of AtCoder has cities numbered through and roads numbered through .
Road leads from City to City , but you cannot use it to get from City to City .
Puma is planning her journey where she starts at some city, travels along zero or more roads, and finishes at some city.
How many pairs of cities can be the origin and destination of Puma's journey? We distinguish pairs with the same set of cities in different orders.
Constraints
- are distinct.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3 3
1 2
2 3
3 2
7
We have seven pairs of cities that can be the origin and destination: .
3 0
3
We have three pairs of cities that can be the origin and destination: .
4 4
1 2
2 3
3 4
4 1
16
Every pair of cities can be the origin and destination.