Restaurant Bribes

Given a friendship graph and a list of k people to bribe, choose a real bribe for each so the total restaurant revenue minus bribe money is maximized, and print the answer as an exact reduced fraction.

Hard9GraphMathGreedyImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

Eeet is a social service for sharing restaurant ratings. A member can rate a restaurant with an integer from 00 to 1010, or leave no rating at all. The score a member sees for a restaurant is the average of the ratings left by the friends who rated it. A friend who leaves a 00 usually drags that score down, while a friend who leaves no rating does not change it. A restaurant that none of a member's friends rated does not show up for that member.

The Smelly Fish is a new restaurant, and nobody eats there. The owners found out that each person comes at most once and spends 100y100y SEK on that visit, where yy is the score that person sees on Eeet. Everybody pays by card, and the amounts are not rounded.

There are no ratings yet, so the owners picked a few people to bribe for a rating. A person with parameter aa who receives a bribe of xx SEK leaves the rating min(10,x/a)\min(10, \lfloor \sqrt{x}/a \rfloor). A person bribed with 00 SEK still leaves a rating of 00 instead of leaving no rating. A bribed person knows about the scheme and never comes to the restaurant. The owners pick the bribe for each of these people separately, and a bribe can be any nonnegative real amount.

The profit is the money the customers spend minus the money paid out in bribes. Compute the largest profit the owners can reach.

Input

The first line contains three integers nn, mm, and kk (1n1051 \le n \le 10^5, 0m1050 \le m \le 10^5, 0kn0 \le k \le n): the number of people on Eeet, the number of friendships, and the number of people to bribe. People are numbered from 11 to nn.

Each of the next mm lines contains two integers aa and bb (1a,bn1 \le a, b \le n, aba \ne b), the ids of a pair of friends. Friendship holds both ways, and no unordered pair {a,b}\{a, b\} is given twice.

Each of the next kk lines contains two integers ii and aia_i (1in1 \le i \le n, 1ai10001 \le a_i \le 1000), the id of a person to bribe and that person's parameter. No id is given twice. Every person on this list is bribed, possibly with 00 SEK.

Output

Print the maximum profit exactly, as a fraction in lowest terms. If the profit is an integer, print that integer by itself. Otherwise print p/qp/q with no spaces, where q2q \ge 2 and gcd(p,q)=1\gcd(p, q) = 1. The numerator and the denominator can run far past the 6464-bit range, so use exact big-integer arithmetic.