时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
Groundhog is the leader of the Apple religion.
Groundhog intends to spread the Apple Religion in the ZL country. The ZL country consists of
cities.The cities is connected by

undirected roads. Groundhog sent the

follower to the

city, and the followers could go to other cities through roads.
However, due to cultural differences, the guards on the road numbered

will only allow the followers numbered from

to

to pass. The leader gave the

follower

Golden Apples,which can be used to bribe the guard to let the follower pass. Now Groundhog wants to know the number of cities each follwer can reach(if there exists one possible path) to spread the Apple Religion, but Groundhog is too busy eating apple, so the problem is left to you. If you solve this problem, maybe you can get an Golden Apple.
输入描述:
The first line contains an integer
, denoting the number of cities.
In the second line, there are
integers
, as described.
The next
lines each contains four positive integers
which means that city
and
are connected by the
road and allows followers numbered from
to
to pass.
输出描述:
output
lines,the
line contains an integer denoting the number of cities
follower can reach.
备注:
.