How to do it the easy way with a lot of objects to choose with a max.

So, I got some objects, let’s say 10, but I only can choose 5 of them.
Now I can wright down a lot of text in C#, but I know there is a easier way but don’t know how anymore.

Example:

if ( 1 && 2 && 5 && 8 && 10)
{
  // Something like a bool to block the objects 3,4,6,7,9 to use in the if statements
}

Can someone show me a easier way to do this.

How do you select the 5? On what criteria?