Parsing a trace file via a small cmd utility

Given an input stream of "int|int" pairs (one such pair per line), output only those lines for which the right integer has at least k distinct integers on the left side, on the entire input stream. The number k is given as a command line argument.