KABISA
InterviewTime limit2sMemory limit512 MB
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.