P12779 [HackerEarth] appointment dates
普及
题目描述

Rahul's Dad is the CEO of one of the leading companies. Every time somebody seeks for an appointment he calls up his secretary and asks her whether the day is a Sunday or not. He has to keep his caller on hold and is unhappy about it. Knowing that his son Mayank knows a bit of programming he asks him to make a program to help him find all the sundays in a given month of a specific year.

Input:
The first Line contains t an integer, the number of test cases. The next t lines contain to integers first the year and then month.
Output:
Output consists of t lines containing the dates of sundays in that particular month

Constraints :
t<100000, month ≤ 12, 2000 ≤ year ≤ 5000

Test cases updated.. You may submit now

SAMPLE INPUT
2
3 2013
5 2010

SAMPLE OUTPUT
3 10 17 24 31
2 9 16 23 30

输入格式

见题面

输出格式

见题面

样例输入
2 3 2013 5 2010 SAMPLE
样例输出
3 10 17 24 31 2 9 16 23 30