runmonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] notrunmonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def(y): if y % 4 == 0and y % 10 大专栏CCF201503-3(python)0 != 0or y % 400 == 0: return1 else: return0 defweek(y,m,d): sum = 0 for i in range(1850,y): if runnian(i): sum += 366 else: sum += 365 month = [] if runnian(y): month[:] = runmonth for i in range(1,m): sum += month[i-1] else: month[:] = notrunmonth for i in range(1,m): sum += month[i-1] sum += d sum = (sum + 1) % 7 return sum
list1 = [int(x) for x in input().split()] list1[2] = 0if list1[2] == 7else list1[2] for i in range(list1[3],list1[4]+1): if runnian(i): month = runmonth[list1[0]-1] else: month = notrunmonth[list1[0]-1] weekday = week(i,list1[0],1) a = 0 for j in range(month): if (weekday+j) % 7 == list1[2]: a += 1 if a == list1[1]: b = str(list1[0]).zfill(2) d = str(j+1).zfill(2) c = [str(i), '/', b, '/', d] print(''.join(c)) if a < list1[1]: print('none')