codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

25A.md (1021B)


      1 Source: https://codeforces.com/problemset/problem/25/A
      2 
      3 A. IQ test
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Bob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the given *n* numbers differs from the others. Bob observed that one number usually differs from the others in evenness. Help Bob — to check his answers, he needs a program that among the given *n* numbers finds one that is different in evenness.
     22 
     23 Input
     24 
     25 The first line contains integer *n* (3 ≤ *n* ≤ 100) — amount of numbers in the task. The second line contains *n* space-separated natural numbers, not exceeding 100. It is guaranteed, that exactly one of these numbers differs from the others in evenness.
     26 
     27 Output
     28 
     29 Output index of number that differs from the others in evenness. Numbers are numbered from 1 in the input order.
     30 
     31 Examples
     32 
     33 Input
     34 
     35 ```
     36 5  
     37 2 4 7 8 10
     38 ```
     39 
     40 Output
     41 
     42 ```
     43 3
     44 ```
     45 
     46 Input
     47 
     48 ```
     49 4  
     50 1 2 1 1
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 2
     57 ```