#P5737. 【深基7.例3】闰年展示

【深基7.例3】闰年展示

Description

Given x,yx, y, output the number of leap years in the interval [x,y][x, y], and on the next line output all leap year numbers, separated by spaces.

Input Format

Input two positive integers x,yx, y, separated by a space.

Output Format

On the first line, output a positive integer representing the number of leap years in the interval [x,y][x, y].

On the second line, output several positive integers: all leap year numbers in monotonically increasing order by year.

1989 2001
3
1992 1996 2000

Hint

Constraints: the testdata guarantees that 1582x<y30001582 \le x < y \le 3000.

Translated by ChatGPT 5