{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027],[\u0027\\[\u0027,\u0027\\]\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdn.mathjax.org/mathjax/latest/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Adam and Eve enter this year’s ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebration of this contest. This game consists of the dates from January 1, 1900 to November 4, 2001, the contest day. The game starts by randomly choosing a date from this interval. Then, the players, Adam and Eve, make moves in their turn with Adam moving first: Adam, Eve, Adam, Eve, etc. There is only one rule for moves and it is simple: from a current date, a player in his/her turn can move either to the next calendar date or the same day of the next month. When the next month does not have the same day, the player moves only to the next calendar date. For example, from December 19, 1924, you can move either to December 20, 1924, the next calendar date, or January 19, 1925, the same day of the next month. From January 31 2001, however, you can move only to February 1, 2001, because February 31, 2001 is invalid. \n \u003cbr\u003e \n \u003cbr\u003eA player wins the game when he/she exactly reaches the date of November 4, 2001. If a player moves to a date after November 4, 2001, he/she looses the game. \n \u003cbr\u003e \n \u003cbr\u003eWrite a program that decides whether, given an initial date, Adam, the first mover, has a winning strategy. \n \u003cbr\u003e \n \u003cbr\u003eFor this game, you need to identify leap years, where February has 29 days. In the Gregorian calendar, leap years occur in years exactly divisible by four. So, 1993, 1994, and 1995 are not leap years, while 1992 and 1996 are leap years. Additionally, the years ending with 00 are leap years only if they are divisible by 400. So, 1700, 1800, 1900, 2100, and 2200 are not leap years, while 1600, 2000, and 2400 are leap years. \n福利(题意——部分来自百度翻译):亚当和夏娃进入今年的ACM国际大学生程序设计竞赛。昨晚,他们玩日历游戏,庆祝这场比赛。本场比赛由1900年1月1日至2001年11月4日,比赛日。游戏开始随机选择一个日期从这个时间间隔。然后,亚当和夏娃依次操作,并且亚当先操作,游戏开始后他们的操作顺序为:亚当,夏娃,亚当,夏娃...等。这个游戏有两个简单的移动规则:从当前日期,在他/她的回合可以移动到当前日期的下一个下一天或下个月。当下个月没有同一天时,玩家只移动到下一个日历日期.。例如,从1924年12月19日,你可以移动到这一月的下一天1924年12月20日,或移动到下一月的同一天1925年1月19日。然而,从1月31日2001,你只能移动到2001年2月1日,因为2001年2月31日是不存在的。\n第一个玩家达到2001年11月4日的时候,这个玩家就赢得比赛.。如果一个玩家移动到一个日期在2001年11月4日之后,那么他/她就输了这场比赛。\n写一个程序,决定是否给定的初始日期,亚当,第一推动者,有一个双赢的战略。\n对于这个游戏,你需要确定闰年,其中二月有29天。在阳历闰年发生在年整除四。所以,1993,1994,和1995不是闰年,而1992和1996是闰年。此外,本年结束了00年的飞跃只有他们是被400整除。所以,1700,1800,1900,2100,和2200不是闰年,而1600,2000,和闰年。\n \u003cbr\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input consists of T test cases. The number of test cases (T) is given in the first line of the input. Each test case is written in a line and corresponds to an initial date. The three integers in a line, YYYY MM DD, represent the date of the DD-th day of MM-th month in the year of YYYY. Remember that initial dates are randomly chosen from the interval between January 1, 1900 and November 4, 2001. \n福利(来自百度翻译):输入T组测试用例。在第一行输入的测试用例T的数目。每个测试用例是写在一行,并对应于初始日期。在一条线上的三个整数,yyyy-mm-dd,代表在YYYY年MM月DD日。请记住,最初的日期是随机选择的范围在 1900年1月1日和2001年11月4日 之内。\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Print exactly one line for each test case. The line should contain the answer \"YES\" or \"NO\" to the question of whether Adam has a winning strategy against Eve. Since we have T test cases, your program should output totally T lines of \"YES\" or \"NO\". \n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e3 \n2001 11 3 \n2001 11 2 \n2001 10 3 \u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eYES \nNO \nNO \u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":""}}]}