This program is in file lines but it is not a goodsolution. The performance is bad.I think a better solution should make use of everyrandom number generated by Math.Random().