CS494 -- Lab 3: Network Flow - The Topcoder "Singing" Problem

The writeup here is pretty simple -- solve the Singing problem from Topcoder SRM 653, (D1, 450 point problem). The problem description is at the following URL: https://community.topcoder.com/stat?c=problem_statement&pm=13680&rd=16317. Simply read all of the input values (N, low, high and the pitches) on standard input as words.

So, doing the topcoder examples:

UNIX> echo 3 2 2  1 2 3 2 1 2 | Singing
2
UNIX> echo 10 3 7  4 4 5 5 6 5 3 6 | Singing
0
UNIX> echo 6 2 5  5 3 1 6 4 2 | Singing
1
UNIX> echo 10 4 5  1 4 3 5 2 5 7 5 9 | Singing
3
UNIX> echo 100 20 80 2 27 3 53 53 52 52 60 85 89 100 53 60 2 3 53 100 89 40 42 2 53 2 85 | Singing
5
UNIX> 
There is a gradescript that conforms to the constraints.