#B3714. Test Input Generator for Buggy Odd Counter

    ID: 11373 Type: Default 1000ms 256MiB

Test Input Generator for Buggy Odd Counter

Test Input Generator for Buggy Odd Counter

The given buggy program is intended to read an integer \(n\) and \(n\) numbers, and then count the number of odd numbers among them. However, the program checks for oddness using x % 2 == 1, which fails for negative odd numbers since in C++ the modulo of a negative number can be negative. Your task is to submit a program that outputs a set of input data that causes the buggy solution to produce an incorrect result.

Example Bug: For input 3 followed by -3 -5 2, the correct odd count should be 2 (since \(-3\) and \(-5\) are odd), but the buggy code will only count 2 as odd (because -3 % 2 and -5 % 2 do not equal 1).

inputFormat

This problem does not require any input. Your program should simply output a specific test case.

The expected output of your program is a test input for the buggy solution.

outputFormat

Your program should output a test case as follows:

  • The first line is an integer \(n\) representing the count of numbers.
  • The second line contains \(n\) space-separated integers.

For instance, the output 3 in the first line and -3 -5 2 in the second line is a valid counterexample where the buggy solution produces an incorrect result.

sample

dummy
3

-3 -5 2

</p>