KABISA

Interview

Time limit2sMemory limit512 MB

Summary
Given a list of years separated by commas, print the leap years among them, separated by spaces.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Many years ago, people were struggling with 6 hours extra that every year has. They decided to do calculate the 6 hours and keep every year as 365 days. The direct consequence of that calculation happened to the starting point of the new year. For example, they had a new year in winter, summer, fall, or spring. To fix the new years’ time, they decided to add extra day after every 4 years and they called it a leap year and keep the other 3 years 365 days. Your job is to write a program to find what are leap years in the given years.

Input

First line contains the number of test cases (T): 1 ≤ T ≤ 10

Second line indicates the list of given years Y, separated by commas (","). 1 ≤ Y ≤ 2020

Output

The list of leap years separated by space.

Examples1

  1. Example 1

    Input
    1
    2, 1, 8, 6, 10, 12
    
    Expected output
    8 12