using System.Collections.Generic;
Random rnd = new Random();
Nullable<int>[] temp = new Nullable<int>[1024];
Nullable<int> FindRandom(List<int> input, Func<int, bool> predicate) {
if (temp.Length < input.Count) {
temp = new Nullable<int>[input.Count * 2];
Array.Clear(temp, 0, input.Count);
for (int i = 0; i < input.Count; i++) {
var index = rnd.Next(i, input.Count);
if (temp[index] != null) {
public static void Main()