#C7082. Find Winners

    ID: 50914 Type: Default 1000ms 256MiB

Find Winners

Find Winners

You are given a string of space-separated integers representing card values. Your task is to determine the indices of the cards with the minimum (i.e. the lowest) value.

If the input string is empty, print No winners. Otherwise, compute the minimum value among all cards, count how many times this minimum appears, and output the count and the corresponding indices (starting from 0) in order.

Formally, if the card values are given by \(a_0, a_1, \dots, a_{n-1}\), you need to find all indices \(i\) such that \(a_i = \min\{a_0,a_1,\dots,a_{n-1}\}\). The output should display the number of winners on the first line followed by the list of indices on the second line.

inputFormat

The input is provided via standard input (stdin) as a single line containing a space-separated list of integers. Each integer represents the value of a card. If there are no cards (i.e. the input is empty), it indicates no players.

outputFormat

If the input is not empty, output two lines on standard output (stdout):

  • The first line contains the number of winners, which is the count of cards with the minimum value.
  • The second line contains the indices (0-indexed) of those cards separated by a space.

If the input is empty, output No winners (without quotes).

## sample
4 2 2 3 1
1

4

</p>