P3114 [USACO15JAN] Stampede S

Description

Farmer John's N cows (1

Input Format

INPUT: The first line of the input contains N. Each of the following N lines describes a cow with three integers x y r, corresponding to a cow whose left endpoint is at (x,y) at time t=0, moving to the right at a continuous speed of 1 unit of distance every r units of time. The value of x is in the range -1000..-1, the value of y is in the range 1..1,000,000 (and distinct for every cow, to prevent any possible collisions), and the value of r is in the range 1..1,000,000.

Output Format

OUTPUT: A single integer, specifying the number of cows FJ can see during the entire race (from t=0 onward).

Explanation/Hint

SOLUTION NOTES: FJ can see cows 1 and 2 but not cow 3.