UVA-524 - Prime Ring Problem

  • UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt
  • 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
  • 相同題目:ZOJ-d396

題意概要

題目給定一個由 個點所組成的圓環 ( 為偶數),現在要將 的自然數分別填入這 個點中,使得相鄰 個點的數數字和是質數。下圖為 的情形。


Input

The input can contain different test cases. The first line of the input indicates the number of test cases. For each test case, there is a line with two numbers: . represents the month (from to ) and represents the day (from to ). The date will always be valid.


Output

For each test case, you have to output the day of the week where that date occurs in 2011. The days of the week will be: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.


Sample Input

8
1 6
2 28
4 5
5 26
8 1
11 1
12 25
12 31

Sample Output

Thursday
Monday
Tuesday
Thursday
Monday
Tuesday
Sunday
Saturday
profile-image
David Lu
Hello, I'm David Lu. I am a graduate student in Department of Computer Science at National Chiao Tung University, Taiwan. I am in the Networking and Sensing Systems (NSS) Lab at NCTU. If you have any question, please feel free to contact with me.
comments powered by Disqus