]> pd.if.org Git - pdclib/blob - functions/time/strftime.c
Better testing of week calculations, fixes.
[pdclib] / functions / time / strftime.c
1 /* strftime( char * restrict, size_t, const char * restrict, const struct tm * restrict )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <time.h>
8 #include <stdlib.h>
9 #include <locale.h>
10 #include <string.h>
11 #include <assert.h>
12
13 #ifndef REGTEST
14
15 /* TODO: Alternative representations / numerals not supported. Multibyte support missing. */
16
17 /* This implementation's code is highly repetitive, but I did not really
18    care for putting it into a number of macros / helper functions.
19 */
20
21 enum wstart_t
22 {
23     E_SUNDAY = 0,
24     E_MONDAY = 1
25 };
26
27 #include <stdio.h>
28
29 static int weeknr( const struct tm * timeptr, int wstart )
30 {
31     int wday = ( timeptr->tm_wday + 7 - wstart ) % 7;
32     div_t week = div( timeptr->tm_yday, 7 );
33     if ( week.rem >= wday )
34     {
35         ++week.quot;
36     }
37     return week.quot;
38 }
39
40 static int iso_week( const struct tm * timeptr )
41 {
42     /* calculations below rely on Sunday == 7 */
43     int wday = timeptr->tm_wday;
44     if ( wday == 0 )
45     {
46         wday = 7;
47     }
48     /* https://en.wikipedia.org/wiki/ISO_week_date */
49     int week = ( timeptr->tm_yday - wday + 11 ) / 7;
50     if ( week == 53 )
51     {
52         /* date *may* belong to the *next* year, if:
53            * it is 31.12. and Monday - Wednesday
54            * it is 30.12. and Monday - Tuesday
55            * it is 29.12. and Monday
56            We can safely assume December...
57         */
58         if ( ( timeptr->tm_yday - wday - _PDCLIB_is_leap( timeptr->tm_year ) ) > 360 )
59         {
60             week = 1;
61         }
62     }
63     else if ( week == 0 )
64     {
65         /* date *does* belong to *previous* year,
66            i.e. has week 52 *unless*...
67            * current year started on a Friday, or
68            * previous year is leap and this year
69              started on a Saturday.
70         */
71         int firstday = timeptr->tm_wday - ( timeptr->tm_yday % 7 );
72         if ( firstday < 0 )
73         {
74             firstday += 7;
75         }
76         if ( ( firstday == 5 ) || ( _PDCLIB_is_leap( timeptr->tm_year - 1 ) && firstday == 6 ) )
77         {
78             week = 53;
79         }
80         else
81         {
82             week = 52;
83         }
84     }
85     return week;
86 }
87
88 static int sprints( char * _PDCLIB_restrict dest, const char * _PDCLIB_restrict src, size_t maxsize, size_t * rc )
89 {
90     size_t len = strlen( src );
91     if ( *rc < ( maxsize - len ) )
92     {
93         strcpy( dest + *rc, src );
94         *rc += len;
95         return 1;
96     }
97     else
98     {
99         return 0;
100     }
101 }
102
103 size_t strftime( char * _PDCLIB_restrict s, size_t maxsize, const char * _PDCLIB_restrict format, const struct tm * _PDCLIB_restrict timeptr )
104 {
105     size_t rc = 0;
106
107     while ( rc < maxsize )
108     {
109         if ( *format != '%' )
110         {
111             if ( ( s[rc] = *format++ ) == '\0' )
112             {
113                 return rc;
114             }
115             else
116             {
117                 ++rc;
118             }
119         }
120         else
121         {
122             /* char flag = 0; */
123             switch ( *++format )
124             {
125                 case 'E':
126                 case 'O':
127                     /* flag = *format++; */
128                     break;
129                 default:
130                     /* EMPTY */
131                     break;
132             }
133             switch( *format++ )
134             {
135                 case 'a':
136                     {
137                         /* tm_wday abbreviated */
138                         if ( ! sprints( s, _PDCLIB_lconv.day_name_abbr[ timeptr->tm_wday ], maxsize, &rc ) )
139                         {
140                             return 0;
141                         }
142                         break;
143                     }
144                 case 'A':
145                     {
146                         /* tm_wday full */
147                         if ( ! sprints( s, _PDCLIB_lconv.day_name_full[ timeptr->tm_wday ], maxsize, &rc ) )
148                         {
149                             return 0;
150                         }
151                         break;
152                     }
153                 case 'b':
154                 case 'h':
155                     {
156                         /* tm_mon abbreviated */
157                         if ( ! sprints( s, _PDCLIB_lconv.month_name_abbr[ timeptr->tm_mon ], maxsize, &rc ) )
158                         {
159                             return 0;
160                         }
161                         break;
162                     }
163                 case 'B':
164                     {
165                         /* tm_mon full */
166                         if ( ! sprints( s, _PDCLIB_lconv.month_name_full[ timeptr->tm_mon ], maxsize, &rc ) )
167                         {
168                             return 0;
169                         }
170                         break;
171                     }
172                 case 'c':
173                     {
174                         /* locale's date / time representation, %a %b %e %T %Y for C locale */
175                         /* 'E' for locale's alternative representation */
176                         size_t count = strftime( s + rc, maxsize - rc, _PDCLIB_lconv.date_time_format, timeptr );
177                         if ( count == 0 )
178                         {
179                             return 0;
180                         }
181                         else
182                         {
183                             rc += count;
184                         }
185                         break;
186                     }
187                 case 'C':
188                     {
189                         /* tm_year divided by 100, truncated to decimal (00-99) */
190                         /* 'E' for base year (period) in locale's alternative representation */
191                         if ( rc < ( maxsize - 2 ) )
192                         {
193                             div_t period = div( ( ( timeptr->tm_year + 1900 ) / 100 ), 10 );
194                             s[rc++] = '0' + period.quot;
195                             s[rc++] = '0' + period.rem;
196                         }
197                         else
198                         {
199                             return 0;
200                         }
201                         break;
202                     }
203                 case 'd':
204                     {
205                         /* tm_mday as decimal (01-31) */
206                         /* 'O' for locale's alternative numeric symbols */
207                         if ( rc < ( maxsize - 2 ) )
208                         {
209                             div_t day = div( timeptr->tm_mday, 10 );
210                             s[rc++] = '0' + day.quot;
211                             s[rc++] = '0' + day.rem;
212                         }
213                         else
214                         {
215                             return 0;
216                         }
217                         break;
218                     }
219                 case 'D':
220                     {
221                         /* %m/%d/%y */
222                         size_t count = strftime( s + rc, maxsize - rc, "%m/%d/%y", timeptr );
223                         if ( count == 0 )
224                         {
225                             return 0;
226                         }
227                         else
228                         {
229                             rc += count;
230                         }
231                         break;
232                     }
233                 case 'e':
234                     {
235                         /* tm_mday as decimal ( 1-31) */
236                         /* 'O' for locale's alternative numeric symbols */
237                         if ( rc < ( maxsize - 2 ) )
238                         {
239                             div_t day = div( timeptr->tm_mday, 10 );
240                             s[rc++] = ( day.quot > 0 ) ? '0' + day.quot : ' ';
241                             s[rc++] = '0' + day.rem;
242                         }
243                         else
244                         {
245                             return 0;
246                         }
247                         break;
248                     }
249                 case 'F':
250                     {
251                         /* %Y-%m-%d */
252                         size_t count = strftime( s + rc, maxsize - rc, "%Y-%m-%d", timeptr );
253                         if ( count == 0 )
254                         {
255                             return 0;
256                         }
257                         else
258                         {
259                             rc += count;
260                         }
261                         break;
262                     }
263                 case 'g':
264                     {
265                         /* last 2 digits of the week-based year as decimal (00-99) */
266                         if ( rc < ( maxsize - 2 ) )
267                         {
268                             int week = iso_week( timeptr );
269                             int bias = 0;
270                             if ( week >= 52 && timeptr->tm_mon == 0 )
271                             {
272                                 --bias;
273                             }
274                             else if ( week == 1 && timeptr->tm_mon == 11 )
275                             {
276                                 ++bias;
277                             }
278                             div_t year = div( timeptr->tm_year % 100 + bias, 10 );
279                             s[rc++] = '0' + year.quot;
280                             s[rc++] = '0' + year.rem;
281                         }
282                         else
283                         {
284                             return 0;
285                         }
286                         break;
287                     }
288                 case 'G':
289                     {
290                         /* week-based year as decimal (e.g. 1997) */
291                         if ( rc < ( maxsize - 4 ) )
292                         {
293                             int week = iso_week( timeptr );
294                             int year = timeptr->tm_year + 1900;
295                             if ( week >= 52 && timeptr->tm_mon == 0 )
296                             {
297                                 --year;
298                             }
299                             else if ( week == 1 && timeptr->tm_mon == 11 )
300                             {
301                                 ++year;
302                             }
303                             for ( int i = 3; i >= 0; --i )
304                             {
305                                 div_t digit = div( year, 10 );
306                                 s[ rc + i ] = '0' + digit.rem;
307                                 year = digit.quot;
308                             }
309
310                             rc += 4;
311                         }
312                         else
313                         {
314                             return 0;
315                         }
316                         break;
317                     }
318                 case 'H':
319                     {
320                         /* tm_hour as 24h decimal (00-23) */
321                         /* 'O' for locale's alternative numeric symbols */
322                         if ( rc < ( maxsize - 2 ) )
323                         {
324                             div_t hour = div( timeptr->tm_hour, 10 );
325                             s[rc++] = '0' + hour.quot;
326                             s[rc++] = '0' + hour.rem;
327                         }
328                         else
329                         {
330                             return 0;
331                         }
332                         break;
333                     }
334                 case 'I':
335                     {
336                         /* tm_hour as 12h decimal (01-12) */
337                         /* 'O' for locale's alternative numeric symbols */
338                         if ( rc < ( maxsize - 2 ) )
339                         {
340                             div_t hour = div( ( timeptr->tm_hour + 11 ) % 12 + 1, 10 );
341                             s[rc++] = '0' + hour.quot;
342                             s[rc++] = '0' + hour.rem;
343                         }
344                         else
345                         {
346                             return 0;
347                         }
348                         break;
349                     }
350                 case 'j':
351                     {
352                         /* tm_yday as decimal (001-366) */
353                         if ( rc < ( maxsize - 3 ) )
354                         {
355                             div_t yday = div( timeptr->tm_yday + 1, 100 );
356                             s[rc++] = '0' + yday.quot;
357                             s[rc++] = '0' + yday.rem / 10;
358                             s[rc++] = '0' + yday.rem % 10;
359                         }
360                         else
361                         {
362                             return 0;
363                         }
364                         break;
365                     }
366                 case 'm':
367                     {
368                         /* tm_mon as decimal (01-12) */
369                         /* 'O' for locale's alternative numeric symbols */
370                         if ( rc < ( maxsize - 2 ) )
371                         {
372                             div_t mon = div( timeptr->tm_mon + 1, 10 );
373                             s[rc++] = '0' + mon.quot;
374                             s[rc++] = '0' + mon.rem;
375                         }
376                         else
377                         {
378                             return 0;
379                         }
380                         break;
381                     }
382                 case 'M':
383                     {
384                         /* tm_min as decimal (00-59) */
385                         /* 'O' for locale's alternative numeric symbols */
386                         if ( rc < ( maxsize - 2 ) )
387                         {
388                             div_t min = div( timeptr->tm_min, 10 );
389                             s[rc++] = '0' + min.quot;
390                             s[rc++] = '0' + min.rem;
391                         }
392                         else
393                         {
394                             return 0;
395                         }
396                         break;
397                     }
398                 case 'n':
399                     {
400                         /* newline */
401                         s[rc++] = '\n';
402                         break;
403                     }
404                 case 'p':
405                     {
406                         /* tm_hour locale's AM/PM designations */
407                         const char * designation = _PDCLIB_lconv.am_pm[ timeptr->tm_hour > 11 ];
408                         size_t len = strlen( designation );
409                         if ( rc < ( maxsize - len ) )
410                         {
411                             strcpy( s + rc, designation );
412                             rc += len;
413                         }
414                         else
415                         {
416                             return 0;
417                         }
418                         break;
419                     }
420                 case 'r':
421                     {
422                         /* tm_hour / tm_min / tm_sec as locale's 12-hour clock time, %I:%M:%S %p for C locale */
423                         size_t count = strftime( s + rc, maxsize - rc, _PDCLIB_lconv.time_format_12h, timeptr );
424                         if ( count == 0 )
425                         {
426                             return 0;
427                         }
428                         else
429                         {
430                             rc += count;
431                         }
432                         break;
433                     }
434                 case 'R':
435                     {
436                         /* %H:%M */
437                         size_t count = strftime( s + rc, maxsize - rc, "%H:%M", timeptr );
438                         if ( count == 0 )
439                         {
440                             return 0;
441                         }
442                         else
443                         {
444                             rc += count;
445                         }
446                         break;
447                     }
448                 case 'S':
449                     {
450                         /* tm_sec as decimal (00-60) */
451                         /* 'O' for locale's alternative numeric symbols */
452                         if ( rc < ( maxsize - 2 ) )
453                         {
454                             div_t sec = div( timeptr->tm_sec, 10 );
455                             s[rc++] = '0' + sec.quot;
456                             s[rc++] = '0' + sec.rem;
457                         }
458                         else
459                         {
460                             return 0;
461                         }
462                         break;
463                     }
464                 case 't':
465                     {
466                         /* tabulator */
467                         s[rc++] = '\t';
468                         break;
469                     }
470                 case 'T':
471                     {
472                         /* %H:%M:%S */
473                         size_t count = strftime( s + rc, maxsize - rc, "%H:%M:%S", timeptr );
474                         if ( count == 0 )
475                         {
476                             return 0;
477                         }
478                         else
479                         {
480                             rc += count;
481                         }
482                         break;
483                     }
484                 case 'u':
485                     {
486                         /* tm_wday as decimal (1-7) with Monday == 1 */
487                         /* 'O' for locale's alternative numeric symbols */
488                         s[rc++] = ( timeptr->tm_wday == 0 ) ? '7' : '0' + timeptr->tm_wday;
489                         break;
490                     }
491                 case 'U':
492                     {
493                         /* week number of the year (first Sunday as the first day of week 1) as decimal (00-53) */
494                         /* 'O' for locale's alternative numeric symbols */
495                         if ( rc < ( maxsize - 2 ) )
496                         {
497                             div_t week = div( weeknr( timeptr, E_SUNDAY ), 10 );
498                             s[rc++] = '0' + week.quot;
499                             s[rc++] = '0' + week.rem;
500                         }
501                         else
502                         {
503                             return 0;
504                         }
505                         break;
506                     }
507                 case 'V':
508                     {
509                         /* ISO week number as decimal (01-53) */
510                         /* 'O' for locale's alternative numeric symbols */
511                         if ( rc < ( maxsize - 2 ) )
512                         {
513                             div_t week = div( iso_week( timeptr ), 10 );
514                             s[rc++] = '0' + week.quot;
515                             s[rc++] = '0' + week.rem;
516                         }
517                         else
518                         {
519                             return 0;
520                         }
521                         break;
522                     }
523                 case 'w':
524                     {
525                         /* tm_wday as decimal number (0-6) with Sunday == 0 */
526                         /* 'O' for locale's alternative numeric symbols */
527                         s[rc++] = '0' + timeptr->tm_wday;
528                         break;
529                     }
530                 case 'W':
531                     {
532                         /* week number of the year (first Monday as the first day of week 1) as decimal (00-53) */
533                         /* 'O' for locale's alternative numeric symbols */
534                         if ( rc < ( maxsize - 2 ) )
535                         {
536                             div_t week = div( weeknr( timeptr, E_MONDAY ), 10 );
537                             s[rc++] = '0' + week.quot;
538                             s[rc++] = '0' + week.rem;
539                         }
540                         else
541                         {
542                             return 0;
543                         }
544                         break;
545                     }
546                 case 'x':
547                     {
548                         /* locale's date representation, %m/%d/%y for C locale */
549                         /* 'E' for locale's alternative representation */
550                         size_t count = strftime( s + rc, maxsize - rc, _PDCLIB_lconv.date_format, timeptr );
551                         if ( count == 0 )
552                         {
553                             return 0;
554                         }
555                         else
556                         {
557                             rc += count;
558                         }
559                         break;
560                     }
561                 case 'X':
562                     {
563                         /* locale's time representation, %T for C locale */
564                         /* 'E' for locale's alternative representation */
565                         size_t count = strftime( s + rc, maxsize - rc, _PDCLIB_lconv.time_format, timeptr );
566                         if ( count == 0 )
567                         {
568                             return 0;
569                         }
570                         else
571                         {
572                             rc += count;
573                         }
574                         break;
575                     }
576                 case 'y':
577                     {
578                         /* last 2 digits of tm_year as decimal (00-99) */
579                         /* 'E' for offset from %EC (year only) in locale's alternative representation */
580                         /* 'O' for locale's alternative numeric symbols */
581                         if ( rc < ( maxsize - 2 ) )
582                         {
583                             div_t year = div( ( timeptr->tm_year % 100 ), 10 );
584                             s[rc++] = '0' + year.quot;
585                             s[rc++] = '0' + year.rem;
586                         }
587                         else
588                         {
589                             return 0;
590                         }
591                         break;
592                     }
593                 case 'Y':
594                     {
595                         /* tm_year as decimal (e.g. 1997) */
596                         /* 'E' for locale's alternative representation */
597                         if ( rc < ( maxsize - 4 ) )
598                         {
599                             int year = timeptr->tm_year + 1900;
600
601                             for ( int i = 3; i >= 0; --i )
602                             {
603                                 div_t digit = div( year, 10 );
604                                 s[ rc + i ] = '0' + digit.rem;
605                                 year = digit.quot;
606                             }
607
608                             rc += 4;
609                         }
610                         else
611                         {
612                             return 0;
613                         }
614                         break;
615                     }
616                 case 'z':
617                     {
618                         /* tm_isdst / UTC offset in ISO8601 format (e.g. -0430 meaning 4 hours 30 minutes behind Greenwich), or no characters */
619                         /* TODO: 'z' */
620                         break;
621                     }
622                 case 'Z':
623                     {
624                         /* tm_isdst / locale's time zone name or abbreviation, or no characters */
625                         /* TODO: 'Z' */
626                         break;
627                     }
628                 case '%':
629                     {
630                         /* '%' character */
631                         s[rc++] = '%';
632                         break;
633                     }
634             }
635         }
636     }
637
638     return 0;
639 }
640
641 #endif
642
643 #ifdef TEST
644
645 #include "_PDCLIB_test.h"
646
647 #define MKTIME( tm, sec, min, hour, day, month, year, wday, yday ) tm.tm_sec = sec; tm.tm_min = min; tm.tm_hour = hour; tm.tm_mday = day; tm.tm_mon = month; tm.tm_year = year; tm.tm_wday = wday; tm.tm_yday = yday; tm.tm_isdst = -1;
648
649 /* Test data generated by reference mktime() / strftime(), listing:
650    * tm_year
651    * tm_wday
652    * tm_yday
653    * '%U' result
654    * '%V' result
655    * '%W' result
656 */
657 int data[1020][6] =
658 {
659 { 70, 4, 0, 0, 1, 0 },
660 { 70, 5, 1, 0, 1, 0 },
661 { 70, 6, 2, 0, 1, 0 },
662 { 70, 0, 3, 1, 1, 0 },
663 { 70, 1, 4, 1, 2, 1 },
664 { 70, 2, 5, 1, 2, 1 },
665 { 70, 3, 6, 1, 2, 1 },
666 { 70, 4, 357, 51, 52, 51 },
667 { 70, 5, 358, 51, 52, 51 },
668 { 70, 6, 359, 51, 52, 51 },
669 { 70, 0, 360, 52, 52, 51 },
670 { 70, 1, 361, 52, 53, 52 },
671 { 70, 2, 362, 52, 53, 52 },
672 { 70, 3, 363, 52, 53, 52 },
673 { 70, 4, 364, 52, 53, 52 },
674 { 71, 5, 0, 0, 53, 0 },
675 { 71, 6, 1, 0, 53, 0 },
676 { 71, 0, 2, 1, 53, 0 },
677 { 71, 1, 3, 1, 1, 1 },
678 { 71, 2, 4, 1, 1, 1 },
679 { 71, 3, 5, 1, 1, 1 },
680 { 71, 4, 6, 1, 1, 1 },
681 { 71, 5, 357, 51, 51, 51 },
682 { 71, 6, 358, 51, 51, 51 },
683 { 71, 0, 359, 52, 51, 51 },
684 { 71, 1, 360, 52, 52, 52 },
685 { 71, 2, 361, 52, 52, 52 },
686 { 71, 3, 362, 52, 52, 52 },
687 { 71, 4, 363, 52, 52, 52 },
688 { 71, 5, 364, 52, 52, 52 },
689 { 72, 6, 0, 0, 52, 0 },
690 { 72, 0, 1, 1, 52, 0 },
691 { 72, 1, 2, 1, 1, 1 },
692 { 72, 2, 3, 1, 1, 1 },
693 { 72, 3, 4, 1, 1, 1 },
694 { 72, 4, 5, 1, 1, 1 },
695 { 72, 5, 6, 1, 1, 1 },
696 { 72, 0, 358, 52, 51, 51 },
697 { 72, 1, 359, 52, 52, 52 },
698 { 72, 2, 360, 52, 52, 52 },
699 { 72, 3, 361, 52, 52, 52 },
700 { 72, 4, 362, 52, 52, 52 },
701 { 72, 5, 363, 52, 52, 52 },
702 { 72, 6, 364, 52, 52, 52 },
703 { 72, 0, 365, 53, 52, 52 },
704 { 73, 1, 0, 0, 1, 1 },
705 { 73, 2, 1, 0, 1, 1 },
706 { 73, 3, 2, 0, 1, 1 },
707 { 73, 4, 3, 0, 1, 1 },
708 { 73, 5, 4, 0, 1, 1 },
709 { 73, 6, 5, 0, 1, 1 },
710 { 73, 0, 6, 1, 1, 1 },
711 { 73, 1, 357, 51, 52, 52 },
712 { 73, 2, 358, 51, 52, 52 },
713 { 73, 3, 359, 51, 52, 52 },
714 { 73, 4, 360, 51, 52, 52 },
715 { 73, 5, 361, 51, 52, 52 },
716 { 73, 6, 362, 51, 52, 52 },
717 { 73, 0, 363, 52, 52, 52 },
718 { 73, 1, 364, 52, 1, 53 },
719 { 74, 2, 0, 0, 1, 0 },
720 { 74, 3, 1, 0, 1, 0 },
721 { 74, 4, 2, 0, 1, 0 },
722 { 74, 5, 3, 0, 1, 0 },
723 { 74, 6, 4, 0, 1, 0 },
724 { 74, 0, 5, 1, 1, 0 },
725 { 74, 1, 6, 1, 2, 1 },
726 { 74, 2, 357, 51, 52, 51 },
727 { 74, 3, 358, 51, 52, 51 },
728 { 74, 4, 359, 51, 52, 51 },
729 { 74, 5, 360, 51, 52, 51 },
730 { 74, 6, 361, 51, 52, 51 },
731 { 74, 0, 362, 52, 52, 51 },
732 { 74, 1, 363, 52, 1, 52 },
733 { 74, 2, 364, 52, 1, 52 },
734 { 75, 3, 0, 0, 1, 0 },
735 { 75, 4, 1, 0, 1, 0 },
736 { 75, 5, 2, 0, 1, 0 },
737 { 75, 6, 3, 0, 1, 0 },
738 { 75, 0, 4, 1, 1, 0 },
739 { 75, 1, 5, 1, 2, 1 },
740 { 75, 2, 6, 1, 2, 1 },
741 { 75, 3, 357, 51, 52, 51 },
742 { 75, 4, 358, 51, 52, 51 },
743 { 75, 5, 359, 51, 52, 51 },
744 { 75, 6, 360, 51, 52, 51 },
745 { 75, 0, 361, 52, 52, 51 },
746 { 75, 1, 362, 52, 1, 52 },
747 { 75, 2, 363, 52, 1, 52 },
748 { 75, 3, 364, 52, 1, 52 },
749 { 76, 4, 0, 0, 1, 0 },
750 { 76, 5, 1, 0, 1, 0 },
751 { 76, 6, 2, 0, 1, 0 },
752 { 76, 0, 3, 1, 1, 0 },
753 { 76, 1, 4, 1, 2, 1 },
754 { 76, 2, 5, 1, 2, 1 },
755 { 76, 3, 6, 1, 2, 1 },
756 { 76, 5, 358, 51, 52, 51 },
757 { 76, 6, 359, 51, 52, 51 },
758 { 76, 0, 360, 52, 52, 51 },
759 { 76, 1, 361, 52, 53, 52 },
760 { 76, 2, 362, 52, 53, 52 },
761 { 76, 3, 363, 52, 53, 52 },
762 { 76, 4, 364, 52, 53, 52 },
763 { 76, 5, 365, 52, 53, 52 },
764 { 77, 6, 0, 0, 53, 0 },
765 { 77, 0, 1, 1, 53, 0 },
766 { 77, 1, 2, 1, 1, 1 },
767 { 77, 2, 3, 1, 1, 1 },
768 { 77, 3, 4, 1, 1, 1 },
769 { 77, 4, 5, 1, 1, 1 },
770 { 77, 5, 6, 1, 1, 1 },
771 { 77, 6, 357, 51, 51, 51 },
772 { 77, 0, 358, 52, 51, 51 },
773 { 77, 1, 359, 52, 52, 52 },
774 { 77, 2, 360, 52, 52, 52 },
775 { 77, 3, 361, 52, 52, 52 },
776 { 77, 4, 362, 52, 52, 52 },
777 { 77, 5, 363, 52, 52, 52 },
778 { 77, 6, 364, 52, 52, 52 },
779 { 78, 0, 0, 1, 52, 0 },
780 { 78, 1, 1, 1, 1, 1 },
781 { 78, 2, 2, 1, 1, 1 },
782 { 78, 3, 3, 1, 1, 1 },
783 { 78, 4, 4, 1, 1, 1 },
784 { 78, 5, 5, 1, 1, 1 },
785 { 78, 6, 6, 1, 1, 1 },
786 { 78, 0, 357, 52, 51, 51 },
787 { 78, 1, 358, 52, 52, 52 },
788 { 78, 2, 359, 52, 52, 52 },
789 { 78, 3, 360, 52, 52, 52 },
790 { 78, 4, 361, 52, 52, 52 },
791 { 78, 5, 362, 52, 52, 52 },
792 { 78, 6, 363, 52, 52, 52 },
793 { 78, 0, 364, 53, 52, 52 },
794 { 79, 1, 0, 0, 1, 1 },
795 { 79, 2, 1, 0, 1, 1 },
796 { 79, 3, 2, 0, 1, 1 },
797 { 79, 4, 3, 0, 1, 1 },
798 { 79, 5, 4, 0, 1, 1 },
799 { 79, 6, 5, 0, 1, 1 },
800 { 79, 0, 6, 1, 1, 1 },
801 { 79, 1, 357, 51, 52, 52 },
802 { 79, 2, 358, 51, 52, 52 },
803 { 79, 3, 359, 51, 52, 52 },
804 { 79, 4, 360, 51, 52, 52 },
805 { 79, 5, 361, 51, 52, 52 },
806 { 79, 6, 362, 51, 52, 52 },
807 { 79, 0, 363, 52, 52, 52 },
808 { 79, 1, 364, 52, 1, 53 },
809 { 80, 2, 0, 0, 1, 0 },
810 { 80, 3, 1, 0, 1, 0 },
811 { 80, 4, 2, 0, 1, 0 },
812 { 80, 5, 3, 0, 1, 0 },
813 { 80, 6, 4, 0, 1, 0 },
814 { 80, 0, 5, 1, 1, 0 },
815 { 80, 1, 6, 1, 2, 1 },
816 { 80, 3, 358, 51, 52, 51 },
817 { 80, 4, 359, 51, 52, 51 },
818 { 80, 5, 360, 51, 52, 51 },
819 { 80, 6, 361, 51, 52, 51 },
820 { 80, 0, 362, 52, 52, 51 },
821 { 80, 1, 363, 52, 1, 52 },
822 { 80, 2, 364, 52, 1, 52 },
823 { 80, 3, 365, 52, 1, 52 },
824 { 81, 4, 0, 0, 1, 0 },
825 { 81, 5, 1, 0, 1, 0 },
826 { 81, 6, 2, 0, 1, 0 },
827 { 81, 0, 3, 1, 1, 0 },
828 { 81, 1, 4, 1, 2, 1 },
829 { 81, 2, 5, 1, 2, 1 },
830 { 81, 3, 6, 1, 2, 1 },
831 { 81, 4, 357, 51, 52, 51 },
832 { 81, 5, 358, 51, 52, 51 },
833 { 81, 6, 359, 51, 52, 51 },
834 { 81, 0, 360, 52, 52, 51 },
835 { 81, 1, 361, 52, 53, 52 },
836 { 81, 2, 362, 52, 53, 52 },
837 { 81, 3, 363, 52, 53, 52 },
838 { 81, 4, 364, 52, 53, 52 },
839 { 82, 5, 0, 0, 53, 0 },
840 { 82, 6, 1, 0, 53, 0 },
841 { 82, 0, 2, 1, 53, 0 },
842 { 82, 1, 3, 1, 1, 1 },
843 { 82, 2, 4, 1, 1, 1 },
844 { 82, 3, 5, 1, 1, 1 },
845 { 82, 4, 6, 1, 1, 1 },
846 { 82, 5, 357, 51, 51, 51 },
847 { 82, 6, 358, 51, 51, 51 },
848 { 82, 0, 359, 52, 51, 51 },
849 { 82, 1, 360, 52, 52, 52 },
850 { 82, 2, 361, 52, 52, 52 },
851 { 82, 3, 362, 52, 52, 52 },
852 { 82, 4, 363, 52, 52, 52 },
853 { 82, 5, 364, 52, 52, 52 },
854 { 83, 6, 0, 0, 52, 0 },
855 { 83, 0, 1, 1, 52, 0 },
856 { 83, 1, 2, 1, 1, 1 },
857 { 83, 2, 3, 1, 1, 1 },
858 { 83, 3, 4, 1, 1, 1 },
859 { 83, 4, 5, 1, 1, 1 },
860 { 83, 5, 6, 1, 1, 1 },
861 { 83, 6, 357, 51, 51, 51 },
862 { 83, 0, 358, 52, 51, 51 },
863 { 83, 1, 359, 52, 52, 52 },
864 { 83, 2, 360, 52, 52, 52 },
865 { 83, 3, 361, 52, 52, 52 },
866 { 83, 4, 362, 52, 52, 52 },
867 { 83, 5, 363, 52, 52, 52 },
868 { 83, 6, 364, 52, 52, 52 },
869 { 84, 0, 0, 1, 52, 0 },
870 { 84, 1, 1, 1, 1, 1 },
871 { 84, 2, 2, 1, 1, 1 },
872 { 84, 3, 3, 1, 1, 1 },
873 { 84, 4, 4, 1, 1, 1 },
874 { 84, 5, 5, 1, 1, 1 },
875 { 84, 6, 6, 1, 1, 1 },
876 { 84, 1, 358, 52, 52, 52 },
877 { 84, 2, 359, 52, 52, 52 },
878 { 84, 3, 360, 52, 52, 52 },
879 { 84, 4, 361, 52, 52, 52 },
880 { 84, 5, 362, 52, 52, 52 },
881 { 84, 6, 363, 52, 52, 52 },
882 { 84, 0, 364, 53, 52, 52 },
883 { 84, 1, 365, 53, 1, 53 },
884 { 85, 2, 0, 0, 1, 0 },
885 { 85, 3, 1, 0, 1, 0 },
886 { 85, 4, 2, 0, 1, 0 },
887 { 85, 5, 3, 0, 1, 0 },
888 { 85, 6, 4, 0, 1, 0 },
889 { 85, 0, 5, 1, 1, 0 },
890 { 85, 1, 6, 1, 2, 1 },
891 { 85, 2, 357, 51, 52, 51 },
892 { 85, 3, 358, 51, 52, 51 },
893 { 85, 4, 359, 51, 52, 51 },
894 { 85, 5, 360, 51, 52, 51 },
895 { 85, 6, 361, 51, 52, 51 },
896 { 85, 0, 362, 52, 52, 51 },
897 { 85, 1, 363, 52, 1, 52 },
898 { 85, 2, 364, 52, 1, 52 },
899 { 86, 3, 0, 0, 1, 0 },
900 { 86, 4, 1, 0, 1, 0 },
901 { 86, 5, 2, 0, 1, 0 },
902 { 86, 6, 3, 0, 1, 0 },
903 { 86, 0, 4, 1, 1, 0 },
904 { 86, 1, 5, 1, 2, 1 },
905 { 86, 2, 6, 1, 2, 1 },
906 { 86, 3, 357, 51, 52, 51 },
907 { 86, 4, 358, 51, 52, 51 },
908 { 86, 5, 359, 51, 52, 51 },
909 { 86, 6, 360, 51, 52, 51 },
910 { 86, 0, 361, 52, 52, 51 },
911 { 86, 1, 362, 52, 1, 52 },
912 { 86, 2, 363, 52, 1, 52 },
913 { 86, 3, 364, 52, 1, 52 },
914 { 87, 4, 0, 0, 1, 0 },
915 { 87, 5, 1, 0, 1, 0 },
916 { 87, 6, 2, 0, 1, 0 },
917 { 87, 0, 3, 1, 1, 0 },
918 { 87, 1, 4, 1, 2, 1 },
919 { 87, 2, 5, 1, 2, 1 },
920 { 87, 3, 6, 1, 2, 1 },
921 { 87, 4, 357, 51, 52, 51 },
922 { 87, 5, 358, 51, 52, 51 },
923 { 87, 6, 359, 51, 52, 51 },
924 { 87, 0, 360, 52, 52, 51 },
925 { 87, 1, 361, 52, 53, 52 },
926 { 87, 2, 362, 52, 53, 52 },
927 { 87, 3, 363, 52, 53, 52 },
928 { 87, 4, 364, 52, 53, 52 },
929 { 88, 5, 0, 0, 53, 0 },
930 { 88, 6, 1, 0, 53, 0 },
931 { 88, 0, 2, 1, 53, 0 },
932 { 88, 1, 3, 1, 1, 1 },
933 { 88, 2, 4, 1, 1, 1 },
934 { 88, 3, 5, 1, 1, 1 },
935 { 88, 4, 6, 1, 1, 1 },
936 { 88, 6, 358, 51, 51, 51 },
937 { 88, 0, 359, 52, 51, 51 },
938 { 88, 1, 360, 52, 52, 52 },
939 { 88, 2, 361, 52, 52, 52 },
940 { 88, 3, 362, 52, 52, 52 },
941 { 88, 4, 363, 52, 52, 52 },
942 { 88, 5, 364, 52, 52, 52 },
943 { 88, 6, 365, 52, 52, 52 },
944 { 89, 0, 0, 1, 52, 0 },
945 { 89, 1, 1, 1, 1, 1 },
946 { 89, 2, 2, 1, 1, 1 },
947 { 89, 3, 3, 1, 1, 1 },
948 { 89, 4, 4, 1, 1, 1 },
949 { 89, 5, 5, 1, 1, 1 },
950 { 89, 6, 6, 1, 1, 1 },
951 { 89, 0, 357, 52, 51, 51 },
952 { 89, 1, 358, 52, 52, 52 },
953 { 89, 2, 359, 52, 52, 52 },
954 { 89, 3, 360, 52, 52, 52 },
955 { 89, 4, 361, 52, 52, 52 },
956 { 89, 5, 362, 52, 52, 52 },
957 { 89, 6, 363, 52, 52, 52 },
958 { 89, 0, 364, 53, 52, 52 },
959 { 90, 1, 0, 0, 1, 1 },
960 { 90, 2, 1, 0, 1, 1 },
961 { 90, 3, 2, 0, 1, 1 },
962 { 90, 4, 3, 0, 1, 1 },
963 { 90, 5, 4, 0, 1, 1 },
964 { 90, 6, 5, 0, 1, 1 },
965 { 90, 0, 6, 1, 1, 1 },
966 { 90, 1, 357, 51, 52, 52 },
967 { 90, 2, 358, 51, 52, 52 },
968 { 90, 3, 359, 51, 52, 52 },
969 { 90, 4, 360, 51, 52, 52 },
970 { 90, 5, 361, 51, 52, 52 },
971 { 90, 6, 362, 51, 52, 52 },
972 { 90, 0, 363, 52, 52, 52 },
973 { 90, 1, 364, 52, 1, 53 },
974 { 91, 2, 0, 0, 1, 0 },
975 { 91, 3, 1, 0, 1, 0 },
976 { 91, 4, 2, 0, 1, 0 },
977 { 91, 5, 3, 0, 1, 0 },
978 { 91, 6, 4, 0, 1, 0 },
979 { 91, 0, 5, 1, 1, 0 },
980 { 91, 1, 6, 1, 2, 1 },
981 { 91, 2, 357, 51, 52, 51 },
982 { 91, 3, 358, 51, 52, 51 },
983 { 91, 4, 359, 51, 52, 51 },
984 { 91, 5, 360, 51, 52, 51 },
985 { 91, 6, 361, 51, 52, 51 },
986 { 91, 0, 362, 52, 52, 51 },
987 { 91, 1, 363, 52, 1, 52 },
988 { 91, 2, 364, 52, 1, 52 },
989 { 92, 3, 0, 0, 1, 0 },
990 { 92, 4, 1, 0, 1, 0 },
991 { 92, 5, 2, 0, 1, 0 },
992 { 92, 6, 3, 0, 1, 0 },
993 { 92, 0, 4, 1, 1, 0 },
994 { 92, 1, 5, 1, 2, 1 },
995 { 92, 2, 6, 1, 2, 1 },
996 { 92, 4, 358, 51, 52, 51 },
997 { 92, 5, 359, 51, 52, 51 },
998 { 92, 6, 360, 51, 52, 51 },
999 { 92, 0, 361, 52, 52, 51 },
1000 { 92, 1, 362, 52, 53, 52 },
1001 { 92, 2, 363, 52, 53, 52 },
1002 { 92, 3, 364, 52, 53, 52 },
1003 { 92, 4, 365, 52, 53, 52 },
1004 { 93, 5, 0, 0, 53, 0 },
1005 { 93, 6, 1, 0, 53, 0 },
1006 { 93, 0, 2, 1, 53, 0 },
1007 { 93, 1, 3, 1, 1, 1 },
1008 { 93, 2, 4, 1, 1, 1 },
1009 { 93, 3, 5, 1, 1, 1 },
1010 { 93, 4, 6, 1, 1, 1 },
1011 { 93, 5, 357, 51, 51, 51 },
1012 { 93, 6, 358, 51, 51, 51 },
1013 { 93, 0, 359, 52, 51, 51 },
1014 { 93, 1, 360, 52, 52, 52 },
1015 { 93, 2, 361, 52, 52, 52 },
1016 { 93, 3, 362, 52, 52, 52 },
1017 { 93, 4, 363, 52, 52, 52 },
1018 { 93, 5, 364, 52, 52, 52 },
1019 { 94, 6, 0, 0, 52, 0 },
1020 { 94, 0, 1, 1, 52, 0 },
1021 { 94, 1, 2, 1, 1, 1 },
1022 { 94, 2, 3, 1, 1, 1 },
1023 { 94, 3, 4, 1, 1, 1 },
1024 { 94, 4, 5, 1, 1, 1 },
1025 { 94, 5, 6, 1, 1, 1 },
1026 { 94, 6, 357, 51, 51, 51 },
1027 { 94, 0, 358, 52, 51, 51 },
1028 { 94, 1, 359, 52, 52, 52 },
1029 { 94, 2, 360, 52, 52, 52 },
1030 { 94, 3, 361, 52, 52, 52 },
1031 { 94, 4, 362, 52, 52, 52 },
1032 { 94, 5, 363, 52, 52, 52 },
1033 { 94, 6, 364, 52, 52, 52 },
1034 { 95, 0, 0, 1, 52, 0 },
1035 { 95, 1, 1, 1, 1, 1 },
1036 { 95, 2, 2, 1, 1, 1 },
1037 { 95, 3, 3, 1, 1, 1 },
1038 { 95, 4, 4, 1, 1, 1 },
1039 { 95, 5, 5, 1, 1, 1 },
1040 { 95, 6, 6, 1, 1, 1 },
1041 { 95, 0, 357, 52, 51, 51 },
1042 { 95, 1, 358, 52, 52, 52 },
1043 { 95, 2, 359, 52, 52, 52 },
1044 { 95, 3, 360, 52, 52, 52 },
1045 { 95, 4, 361, 52, 52, 52 },
1046 { 95, 5, 362, 52, 52, 52 },
1047 { 95, 6, 363, 52, 52, 52 },
1048 { 95, 0, 364, 53, 52, 52 },
1049 { 96, 1, 0, 0, 1, 1 },
1050 { 96, 2, 1, 0, 1, 1 },
1051 { 96, 3, 2, 0, 1, 1 },
1052 { 96, 4, 3, 0, 1, 1 },
1053 { 96, 5, 4, 0, 1, 1 },
1054 { 96, 6, 5, 0, 1, 1 },
1055 { 96, 0, 6, 1, 1, 1 },
1056 { 96, 2, 358, 51, 52, 52 },
1057 { 96, 3, 359, 51, 52, 52 },
1058 { 96, 4, 360, 51, 52, 52 },
1059 { 96, 5, 361, 51, 52, 52 },
1060 { 96, 6, 362, 51, 52, 52 },
1061 { 96, 0, 363, 52, 52, 52 },
1062 { 96, 1, 364, 52, 1, 53 },
1063 { 96, 2, 365, 52, 1, 53 },
1064 { 97, 3, 0, 0, 1, 0 },
1065 { 97, 4, 1, 0, 1, 0 },
1066 { 97, 5, 2, 0, 1, 0 },
1067 { 97, 6, 3, 0, 1, 0 },
1068 { 97, 0, 4, 1, 1, 0 },
1069 { 97, 1, 5, 1, 2, 1 },
1070 { 97, 2, 6, 1, 2, 1 },
1071 { 97, 3, 357, 51, 52, 51 },
1072 { 97, 4, 358, 51, 52, 51 },
1073 { 97, 5, 359, 51, 52, 51 },
1074 { 97, 6, 360, 51, 52, 51 },
1075 { 97, 0, 361, 52, 52, 51 },
1076 { 97, 1, 362, 52, 1, 52 },
1077 { 97, 2, 363, 52, 1, 52 },
1078 { 97, 3, 364, 52, 1, 52 },
1079 { 98, 4, 0, 0, 1, 0 },
1080 { 98, 5, 1, 0, 1, 0 },
1081 { 98, 6, 2, 0, 1, 0 },
1082 { 98, 0, 3, 1, 1, 0 },
1083 { 98, 1, 4, 1, 2, 1 },
1084 { 98, 2, 5, 1, 2, 1 },
1085 { 98, 3, 6, 1, 2, 1 },
1086 { 98, 4, 357, 51, 52, 51 },
1087 { 98, 5, 358, 51, 52, 51 },
1088 { 98, 6, 359, 51, 52, 51 },
1089 { 98, 0, 360, 52, 52, 51 },
1090 { 98, 1, 361, 52, 53, 52 },
1091 { 98, 2, 362, 52, 53, 52 },
1092 { 98, 3, 363, 52, 53, 52 },
1093 { 98, 4, 364, 52, 53, 52 },
1094 { 99, 5, 0, 0, 53, 0 },
1095 { 99, 6, 1, 0, 53, 0 },
1096 { 99, 0, 2, 1, 53, 0 },
1097 { 99, 1, 3, 1, 1, 1 },
1098 { 99, 2, 4, 1, 1, 1 },
1099 { 99, 3, 5, 1, 1, 1 },
1100 { 99, 4, 6, 1, 1, 1 },
1101 { 99, 5, 357, 51, 51, 51 },
1102 { 99, 6, 358, 51, 51, 51 },
1103 { 99, 0, 359, 52, 51, 51 },
1104 { 99, 1, 360, 52, 52, 52 },
1105 { 99, 2, 361, 52, 52, 52 },
1106 { 99, 3, 362, 52, 52, 52 },
1107 { 99, 4, 363, 52, 52, 52 },
1108 { 99, 5, 364, 52, 52, 52 },
1109 { 100, 6, 0, 0, 52, 0 },
1110 { 100, 0, 1, 1, 52, 0 },
1111 { 100, 1, 2, 1, 1, 1 },
1112 { 100, 2, 3, 1, 1, 1 },
1113 { 100, 3, 4, 1, 1, 1 },
1114 { 100, 4, 5, 1, 1, 1 },
1115 { 100, 5, 6, 1, 1, 1 },
1116 { 100, 0, 358, 52, 51, 51 },
1117 { 100, 1, 359, 52, 52, 52 },
1118 { 100, 2, 360, 52, 52, 52 },
1119 { 100, 3, 361, 52, 52, 52 },
1120 { 100, 4, 362, 52, 52, 52 },
1121 { 100, 5, 363, 52, 52, 52 },
1122 { 100, 6, 364, 52, 52, 52 },
1123 { 100, 0, 365, 53, 52, 52 },
1124 { 101, 1, 0, 0, 1, 1 },
1125 { 101, 2, 1, 0, 1, 1 },
1126 { 101, 3, 2, 0, 1, 1 },
1127 { 101, 4, 3, 0, 1, 1 },
1128 { 101, 5, 4, 0, 1, 1 },
1129 { 101, 6, 5, 0, 1, 1 },
1130 { 101, 0, 6, 1, 1, 1 },
1131 { 101, 1, 357, 51, 52, 52 },
1132 { 101, 2, 358, 51, 52, 52 },
1133 { 101, 3, 359, 51, 52, 52 },
1134 { 101, 4, 360, 51, 52, 52 },
1135 { 101, 5, 361, 51, 52, 52 },
1136 { 101, 6, 362, 51, 52, 52 },
1137 { 101, 0, 363, 52, 52, 52 },
1138 { 101, 1, 364, 52, 1, 53 },
1139 { 102, 2, 0, 0, 1, 0 },
1140 { 102, 3, 1, 0, 1, 0 },
1141 { 102, 4, 2, 0, 1, 0 },
1142 { 102, 5, 3, 0, 1, 0 },
1143 { 102, 6, 4, 0, 1, 0 },
1144 { 102, 0, 5, 1, 1, 0 },
1145 { 102, 1, 6, 1, 2, 1 },
1146 { 102, 2, 357, 51, 52, 51 },
1147 { 102, 3, 358, 51, 52, 51 },
1148 { 102, 4, 359, 51, 52, 51 },
1149 { 102, 5, 360, 51, 52, 51 },
1150 { 102, 6, 361, 51, 52, 51 },
1151 { 102, 0, 362, 52, 52, 51 },
1152 { 102, 1, 363, 52, 1, 52 },
1153 { 102, 2, 364, 52, 1, 52 },
1154 { 103, 3, 0, 0, 1, 0 },
1155 { 103, 4, 1, 0, 1, 0 },
1156 { 103, 5, 2, 0, 1, 0 },
1157 { 103, 6, 3, 0, 1, 0 },
1158 { 103, 0, 4, 1, 1, 0 },
1159 { 103, 1, 5, 1, 2, 1 },
1160 { 103, 2, 6, 1, 2, 1 },
1161 { 103, 3, 357, 51, 52, 51 },
1162 { 103, 4, 358, 51, 52, 51 },
1163 { 103, 5, 359, 51, 52, 51 },
1164 { 103, 6, 360, 51, 52, 51 },
1165 { 103, 0, 361, 52, 52, 51 },
1166 { 103, 1, 362, 52, 1, 52 },
1167 { 103, 2, 363, 52, 1, 52 },
1168 { 103, 3, 364, 52, 1, 52 },
1169 { 104, 4, 0, 0, 1, 0 },
1170 { 104, 5, 1, 0, 1, 0 },
1171 { 104, 6, 2, 0, 1, 0 },
1172 { 104, 0, 3, 1, 1, 0 },
1173 { 104, 1, 4, 1, 2, 1 },
1174 { 104, 2, 5, 1, 2, 1 },
1175 { 104, 3, 6, 1, 2, 1 },
1176 { 104, 5, 358, 51, 52, 51 },
1177 { 104, 6, 359, 51, 52, 51 },
1178 { 104, 0, 360, 52, 52, 51 },
1179 { 104, 1, 361, 52, 53, 52 },
1180 { 104, 2, 362, 52, 53, 52 },
1181 { 104, 3, 363, 52, 53, 52 },
1182 { 104, 4, 364, 52, 53, 52 },
1183 { 104, 5, 365, 52, 53, 52 },
1184 { 105, 6, 0, 0, 53, 0 },
1185 { 105, 0, 1, 1, 53, 0 },
1186 { 105, 1, 2, 1, 1, 1 },
1187 { 105, 2, 3, 1, 1, 1 },
1188 { 105, 3, 4, 1, 1, 1 },
1189 { 105, 4, 5, 1, 1, 1 },
1190 { 105, 5, 6, 1, 1, 1 },
1191 { 105, 6, 357, 51, 51, 51 },
1192 { 105, 0, 358, 52, 51, 51 },
1193 { 105, 1, 359, 52, 52, 52 },
1194 { 105, 2, 360, 52, 52, 52 },
1195 { 105, 3, 361, 52, 52, 52 },
1196 { 105, 4, 362, 52, 52, 52 },
1197 { 105, 5, 363, 52, 52, 52 },
1198 { 105, 6, 364, 52, 52, 52 },
1199 { 106, 0, 0, 1, 52, 0 },
1200 { 106, 1, 1, 1, 1, 1 },
1201 { 106, 2, 2, 1, 1, 1 },
1202 { 106, 3, 3, 1, 1, 1 },
1203 { 106, 4, 4, 1, 1, 1 },
1204 { 106, 5, 5, 1, 1, 1 },
1205 { 106, 6, 6, 1, 1, 1 },
1206 { 106, 0, 357, 52, 51, 51 },
1207 { 106, 1, 358, 52, 52, 52 },
1208 { 106, 2, 359, 52, 52, 52 },
1209 { 106, 3, 360, 52, 52, 52 },
1210 { 106, 4, 361, 52, 52, 52 },
1211 { 106, 5, 362, 52, 52, 52 },
1212 { 106, 6, 363, 52, 52, 52 },
1213 { 106, 0, 364, 53, 52, 52 },
1214 { 107, 1, 0, 0, 1, 1 },
1215 { 107, 2, 1, 0, 1, 1 },
1216 { 107, 3, 2, 0, 1, 1 },
1217 { 107, 4, 3, 0, 1, 1 },
1218 { 107, 5, 4, 0, 1, 1 },
1219 { 107, 6, 5, 0, 1, 1 },
1220 { 107, 0, 6, 1, 1, 1 },
1221 { 107, 1, 357, 51, 52, 52 },
1222 { 107, 2, 358, 51, 52, 52 },
1223 { 107, 3, 359, 51, 52, 52 },
1224 { 107, 4, 360, 51, 52, 52 },
1225 { 107, 5, 361, 51, 52, 52 },
1226 { 107, 6, 362, 51, 52, 52 },
1227 { 107, 0, 363, 52, 52, 52 },
1228 { 107, 1, 364, 52, 1, 53 },
1229 { 108, 2, 0, 0, 1, 0 },
1230 { 108, 3, 1, 0, 1, 0 },
1231 { 108, 4, 2, 0, 1, 0 },
1232 { 108, 5, 3, 0, 1, 0 },
1233 { 108, 6, 4, 0, 1, 0 },
1234 { 108, 0, 5, 1, 1, 0 },
1235 { 108, 1, 6, 1, 2, 1 },
1236 { 108, 3, 358, 51, 52, 51 },
1237 { 108, 4, 359, 51, 52, 51 },
1238 { 108, 5, 360, 51, 52, 51 },
1239 { 108, 6, 361, 51, 52, 51 },
1240 { 108, 0, 362, 52, 52, 51 },
1241 { 108, 1, 363, 52, 1, 52 },
1242 { 108, 2, 364, 52, 1, 52 },
1243 { 108, 3, 365, 52, 1, 52 },
1244 { 109, 4, 0, 0, 1, 0 },
1245 { 109, 5, 1, 0, 1, 0 },
1246 { 109, 6, 2, 0, 1, 0 },
1247 { 109, 0, 3, 1, 1, 0 },
1248 { 109, 1, 4, 1, 2, 1 },
1249 { 109, 2, 5, 1, 2, 1 },
1250 { 109, 3, 6, 1, 2, 1 },
1251 { 109, 4, 357, 51, 52, 51 },
1252 { 109, 5, 358, 51, 52, 51 },
1253 { 109, 6, 359, 51, 52, 51 },
1254 { 109, 0, 360, 52, 52, 51 },
1255 { 109, 1, 361, 52, 53, 52 },
1256 { 109, 2, 362, 52, 53, 52 },
1257 { 109, 3, 363, 52, 53, 52 },
1258 { 109, 4, 364, 52, 53, 52 },
1259 { 110, 5, 0, 0, 53, 0 },
1260 { 110, 6, 1, 0, 53, 0 },
1261 { 110, 0, 2, 1, 53, 0 },
1262 { 110, 1, 3, 1, 1, 1 },
1263 { 110, 2, 4, 1, 1, 1 },
1264 { 110, 3, 5, 1, 1, 1 },
1265 { 110, 4, 6, 1, 1, 1 },
1266 { 110, 5, 357, 51, 51, 51 },
1267 { 110, 6, 358, 51, 51, 51 },
1268 { 110, 0, 359, 52, 51, 51 },
1269 { 110, 1, 360, 52, 52, 52 },
1270 { 110, 2, 361, 52, 52, 52 },
1271 { 110, 3, 362, 52, 52, 52 },
1272 { 110, 4, 363, 52, 52, 52 },
1273 { 110, 5, 364, 52, 52, 52 },
1274 { 111, 6, 0, 0, 52, 0 },
1275 { 111, 0, 1, 1, 52, 0 },
1276 { 111, 1, 2, 1, 1, 1 },
1277 { 111, 2, 3, 1, 1, 1 },
1278 { 111, 3, 4, 1, 1, 1 },
1279 { 111, 4, 5, 1, 1, 1 },
1280 { 111, 5, 6, 1, 1, 1 },
1281 { 111, 6, 357, 51, 51, 51 },
1282 { 111, 0, 358, 52, 51, 51 },
1283 { 111, 1, 359, 52, 52, 52 },
1284 { 111, 2, 360, 52, 52, 52 },
1285 { 111, 3, 361, 52, 52, 52 },
1286 { 111, 4, 362, 52, 52, 52 },
1287 { 111, 5, 363, 52, 52, 52 },
1288 { 111, 6, 364, 52, 52, 52 },
1289 { 112, 0, 0, 1, 52, 0 },
1290 { 112, 1, 1, 1, 1, 1 },
1291 { 112, 2, 2, 1, 1, 1 },
1292 { 112, 3, 3, 1, 1, 1 },
1293 { 112, 4, 4, 1, 1, 1 },
1294 { 112, 5, 5, 1, 1, 1 },
1295 { 112, 6, 6, 1, 1, 1 },
1296 { 112, 1, 358, 52, 52, 52 },
1297 { 112, 2, 359, 52, 52, 52 },
1298 { 112, 3, 360, 52, 52, 52 },
1299 { 112, 4, 361, 52, 52, 52 },
1300 { 112, 5, 362, 52, 52, 52 },
1301 { 112, 6, 363, 52, 52, 52 },
1302 { 112, 0, 364, 53, 52, 52 },
1303 { 112, 1, 365, 53, 1, 53 },
1304 { 113, 2, 0, 0, 1, 0 },
1305 { 113, 3, 1, 0, 1, 0 },
1306 { 113, 4, 2, 0, 1, 0 },
1307 { 113, 5, 3, 0, 1, 0 },
1308 { 113, 6, 4, 0, 1, 0 },
1309 { 113, 0, 5, 1, 1, 0 },
1310 { 113, 1, 6, 1, 2, 1 },
1311 { 113, 2, 357, 51, 52, 51 },
1312 { 113, 3, 358, 51, 52, 51 },
1313 { 113, 4, 359, 51, 52, 51 },
1314 { 113, 5, 360, 51, 52, 51 },
1315 { 113, 6, 361, 51, 52, 51 },
1316 { 113, 0, 362, 52, 52, 51 },
1317 { 113, 1, 363, 52, 1, 52 },
1318 { 113, 2, 364, 52, 1, 52 },
1319 { 114, 3, 0, 0, 1, 0 },
1320 { 114, 4, 1, 0, 1, 0 },
1321 { 114, 5, 2, 0, 1, 0 },
1322 { 114, 6, 3, 0, 1, 0 },
1323 { 114, 0, 4, 1, 1, 0 },
1324 { 114, 1, 5, 1, 2, 1 },
1325 { 114, 2, 6, 1, 2, 1 },
1326 { 114, 3, 357, 51, 52, 51 },
1327 { 114, 4, 358, 51, 52, 51 },
1328 { 114, 5, 359, 51, 52, 51 },
1329 { 114, 6, 360, 51, 52, 51 },
1330 { 114, 0, 361, 52, 52, 51 },
1331 { 114, 1, 362, 52, 1, 52 },
1332 { 114, 2, 363, 52, 1, 52 },
1333 { 114, 3, 364, 52, 1, 52 },
1334 { 115, 4, 0, 0, 1, 0 },
1335 { 115, 5, 1, 0, 1, 0 },
1336 { 115, 6, 2, 0, 1, 0 },
1337 { 115, 0, 3, 1, 1, 0 },
1338 { 115, 1, 4, 1, 2, 1 },
1339 { 115, 2, 5, 1, 2, 1 },
1340 { 115, 3, 6, 1, 2, 1 },
1341 { 115, 4, 357, 51, 52, 51 },
1342 { 115, 5, 358, 51, 52, 51 },
1343 { 115, 6, 359, 51, 52, 51 },
1344 { 115, 0, 360, 52, 52, 51 },
1345 { 115, 1, 361, 52, 53, 52 },
1346 { 115, 2, 362, 52, 53, 52 },
1347 { 115, 3, 363, 52, 53, 52 },
1348 { 115, 4, 364, 52, 53, 52 },
1349 { 116, 5, 0, 0, 53, 0 },
1350 { 116, 6, 1, 0, 53, 0 },
1351 { 116, 0, 2, 1, 53, 0 },
1352 { 116, 1, 3, 1, 1, 1 },
1353 { 116, 2, 4, 1, 1, 1 },
1354 { 116, 3, 5, 1, 1, 1 },
1355 { 116, 4, 6, 1, 1, 1 },
1356 { 116, 6, 358, 51, 51, 51 },
1357 { 116, 0, 359, 52, 51, 51 },
1358 { 116, 1, 360, 52, 52, 52 },
1359 { 116, 2, 361, 52, 52, 52 },
1360 { 116, 3, 362, 52, 52, 52 },
1361 { 116, 4, 363, 52, 52, 52 },
1362 { 116, 5, 364, 52, 52, 52 },
1363 { 116, 6, 365, 52, 52, 52 },
1364 { 117, 0, 0, 1, 52, 0 },
1365 { 117, 1, 1, 1, 1, 1 },
1366 { 117, 2, 2, 1, 1, 1 },
1367 { 117, 3, 3, 1, 1, 1 },
1368 { 117, 4, 4, 1, 1, 1 },
1369 { 117, 5, 5, 1, 1, 1 },
1370 { 117, 6, 6, 1, 1, 1 },
1371 { 117, 0, 357, 52, 51, 51 },
1372 { 117, 1, 358, 52, 52, 52 },
1373 { 117, 2, 359, 52, 52, 52 },
1374 { 117, 3, 360, 52, 52, 52 },
1375 { 117, 4, 361, 52, 52, 52 },
1376 { 117, 5, 362, 52, 52, 52 },
1377 { 117, 6, 363, 52, 52, 52 },
1378 { 117, 0, 364, 53, 52, 52 },
1379 { 118, 1, 0, 0, 1, 1 },
1380 { 118, 2, 1, 0, 1, 1 },
1381 { 118, 3, 2, 0, 1, 1 },
1382 { 118, 4, 3, 0, 1, 1 },
1383 { 118, 5, 4, 0, 1, 1 },
1384 { 118, 6, 5, 0, 1, 1 },
1385 { 118, 0, 6, 1, 1, 1 },
1386 { 118, 1, 357, 51, 52, 52 },
1387 { 118, 2, 358, 51, 52, 52 },
1388 { 118, 3, 359, 51, 52, 52 },
1389 { 118, 4, 360, 51, 52, 52 },
1390 { 118, 5, 361, 51, 52, 52 },
1391 { 118, 6, 362, 51, 52, 52 },
1392 { 118, 0, 363, 52, 52, 52 },
1393 { 118, 1, 364, 52, 1, 53 },
1394 { 119, 2, 0, 0, 1, 0 },
1395 { 119, 3, 1, 0, 1, 0 },
1396 { 119, 4, 2, 0, 1, 0 },
1397 { 119, 5, 3, 0, 1, 0 },
1398 { 119, 6, 4, 0, 1, 0 },
1399 { 119, 0, 5, 1, 1, 0 },
1400 { 119, 1, 6, 1, 2, 1 },
1401 { 119, 2, 357, 51, 52, 51 },
1402 { 119, 3, 358, 51, 52, 51 },
1403 { 119, 4, 359, 51, 52, 51 },
1404 { 119, 5, 360, 51, 52, 51 },
1405 { 119, 6, 361, 51, 52, 51 },
1406 { 119, 0, 362, 52, 52, 51 },
1407 { 119, 1, 363, 52, 1, 52 },
1408 { 119, 2, 364, 52, 1, 52 },
1409 { 120, 3, 0, 0, 1, 0 },
1410 { 120, 4, 1, 0, 1, 0 },
1411 { 120, 5, 2, 0, 1, 0 },
1412 { 120, 6, 3, 0, 1, 0 },
1413 { 120, 0, 4, 1, 1, 0 },
1414 { 120, 1, 5, 1, 2, 1 },
1415 { 120, 2, 6, 1, 2, 1 },
1416 { 120, 4, 358, 51, 52, 51 },
1417 { 120, 5, 359, 51, 52, 51 },
1418 { 120, 6, 360, 51, 52, 51 },
1419 { 120, 0, 361, 52, 52, 51 },
1420 { 120, 1, 362, 52, 53, 52 },
1421 { 120, 2, 363, 52, 53, 52 },
1422 { 120, 3, 364, 52, 53, 52 },
1423 { 120, 4, 365, 52, 53, 52 },
1424 { 121, 5, 0, 0, 53, 0 },
1425 { 121, 6, 1, 0, 53, 0 },
1426 { 121, 0, 2, 1, 53, 0 },
1427 { 121, 1, 3, 1, 1, 1 },
1428 { 121, 2, 4, 1, 1, 1 },
1429 { 121, 3, 5, 1, 1, 1 },
1430 { 121, 4, 6, 1, 1, 1 },
1431 { 121, 5, 357, 51, 51, 51 },
1432 { 121, 6, 358, 51, 51, 51 },
1433 { 121, 0, 359, 52, 51, 51 },
1434 { 121, 1, 360, 52, 52, 52 },
1435 { 121, 2, 361, 52, 52, 52 },
1436 { 121, 3, 362, 52, 52, 52 },
1437 { 121, 4, 363, 52, 52, 52 },
1438 { 121, 5, 364, 52, 52, 52 },
1439 { 122, 6, 0, 0, 52, 0 },
1440 { 122, 0, 1, 1, 52, 0 },
1441 { 122, 1, 2, 1, 1, 1 },
1442 { 122, 2, 3, 1, 1, 1 },
1443 { 122, 3, 4, 1, 1, 1 },
1444 { 122, 4, 5, 1, 1, 1 },
1445 { 122, 5, 6, 1, 1, 1 },
1446 { 122, 6, 357, 51, 51, 51 },
1447 { 122, 0, 358, 52, 51, 51 },
1448 { 122, 1, 359, 52, 52, 52 },
1449 { 122, 2, 360, 52, 52, 52 },
1450 { 122, 3, 361, 52, 52, 52 },
1451 { 122, 4, 362, 52, 52, 52 },
1452 { 122, 5, 363, 52, 52, 52 },
1453 { 122, 6, 364, 52, 52, 52 },
1454 { 123, 0, 0, 1, 52, 0 },
1455 { 123, 1, 1, 1, 1, 1 },
1456 { 123, 2, 2, 1, 1, 1 },
1457 { 123, 3, 3, 1, 1, 1 },
1458 { 123, 4, 4, 1, 1, 1 },
1459 { 123, 5, 5, 1, 1, 1 },
1460 { 123, 6, 6, 1, 1, 1 },
1461 { 123, 0, 357, 52, 51, 51 },
1462 { 123, 1, 358, 52, 52, 52 },
1463 { 123, 2, 359, 52, 52, 52 },
1464 { 123, 3, 360, 52, 52, 52 },
1465 { 123, 4, 361, 52, 52, 52 },
1466 { 123, 5, 362, 52, 52, 52 },
1467 { 123, 6, 363, 52, 52, 52 },
1468 { 123, 0, 364, 53, 52, 52 },
1469 { 124, 1, 0, 0, 1, 1 },
1470 { 124, 2, 1, 0, 1, 1 },
1471 { 124, 3, 2, 0, 1, 1 },
1472 { 124, 4, 3, 0, 1, 1 },
1473 { 124, 5, 4, 0, 1, 1 },
1474 { 124, 6, 5, 0, 1, 1 },
1475 { 124, 0, 6, 1, 1, 1 },
1476 { 124, 2, 358, 51, 52, 52 },
1477 { 124, 3, 359, 51, 52, 52 },
1478 { 124, 4, 360, 51, 52, 52 },
1479 { 124, 5, 361, 51, 52, 52 },
1480 { 124, 6, 362, 51, 52, 52 },
1481 { 124, 0, 363, 52, 52, 52 },
1482 { 124, 1, 364, 52, 1, 53 },
1483 { 124, 2, 365, 52, 1, 53 },
1484 { 125, 3, 0, 0, 1, 0 },
1485 { 125, 4, 1, 0, 1, 0 },
1486 { 125, 5, 2, 0, 1, 0 },
1487 { 125, 6, 3, 0, 1, 0 },
1488 { 125, 0, 4, 1, 1, 0 },
1489 { 125, 1, 5, 1, 2, 1 },
1490 { 125, 2, 6, 1, 2, 1 },
1491 { 125, 3, 357, 51, 52, 51 },
1492 { 125, 4, 358, 51, 52, 51 },
1493 { 125, 5, 359, 51, 52, 51 },
1494 { 125, 6, 360, 51, 52, 51 },
1495 { 125, 0, 361, 52, 52, 51 },
1496 { 125, 1, 362, 52, 1, 52 },
1497 { 125, 2, 363, 52, 1, 52 },
1498 { 125, 3, 364, 52, 1, 52 },
1499 { 126, 4, 0, 0, 1, 0 },
1500 { 126, 5, 1, 0, 1, 0 },
1501 { 126, 6, 2, 0, 1, 0 },
1502 { 126, 0, 3, 1, 1, 0 },
1503 { 126, 1, 4, 1, 2, 1 },
1504 { 126, 2, 5, 1, 2, 1 },
1505 { 126, 3, 6, 1, 2, 1 },
1506 { 126, 4, 357, 51, 52, 51 },
1507 { 126, 5, 358, 51, 52, 51 },
1508 { 126, 6, 359, 51, 52, 51 },
1509 { 126, 0, 360, 52, 52, 51 },
1510 { 126, 1, 361, 52, 53, 52 },
1511 { 126, 2, 362, 52, 53, 52 },
1512 { 126, 3, 363, 52, 53, 52 },
1513 { 126, 4, 364, 52, 53, 52 },
1514 { 127, 5, 0, 0, 53, 0 },
1515 { 127, 6, 1, 0, 53, 0 },
1516 { 127, 0, 2, 1, 53, 0 },
1517 { 127, 1, 3, 1, 1, 1 },
1518 { 127, 2, 4, 1, 1, 1 },
1519 { 127, 3, 5, 1, 1, 1 },
1520 { 127, 4, 6, 1, 1, 1 },
1521 { 127, 5, 357, 51, 51, 51 },
1522 { 127, 6, 358, 51, 51, 51 },
1523 { 127, 0, 359, 52, 51, 51 },
1524 { 127, 1, 360, 52, 52, 52 },
1525 { 127, 2, 361, 52, 52, 52 },
1526 { 127, 3, 362, 52, 52, 52 },
1527 { 127, 4, 363, 52, 52, 52 },
1528 { 127, 5, 364, 52, 52, 52 },
1529 { 128, 6, 0, 0, 52, 0 },
1530 { 128, 0, 1, 1, 52, 0 },
1531 { 128, 1, 2, 1, 1, 1 },
1532 { 128, 2, 3, 1, 1, 1 },
1533 { 128, 3, 4, 1, 1, 1 },
1534 { 128, 4, 5, 1, 1, 1 },
1535 { 128, 5, 6, 1, 1, 1 },
1536 { 128, 0, 358, 52, 51, 51 },
1537 { 128, 1, 359, 52, 52, 52 },
1538 { 128, 2, 360, 52, 52, 52 },
1539 { 128, 3, 361, 52, 52, 52 },
1540 { 128, 4, 362, 52, 52, 52 },
1541 { 128, 5, 363, 52, 52, 52 },
1542 { 128, 6, 364, 52, 52, 52 },
1543 { 128, 0, 365, 53, 52, 52 },
1544 { 129, 1, 0, 0, 1, 1 },
1545 { 129, 2, 1, 0, 1, 1 },
1546 { 129, 3, 2, 0, 1, 1 },
1547 { 129, 4, 3, 0, 1, 1 },
1548 { 129, 5, 4, 0, 1, 1 },
1549 { 129, 6, 5, 0, 1, 1 },
1550 { 129, 0, 6, 1, 1, 1 },
1551 { 129, 1, 357, 51, 52, 52 },
1552 { 129, 2, 358, 51, 52, 52 },
1553 { 129, 3, 359, 51, 52, 52 },
1554 { 129, 4, 360, 51, 52, 52 },
1555 { 129, 5, 361, 51, 52, 52 },
1556 { 129, 6, 362, 51, 52, 52 },
1557 { 129, 0, 363, 52, 52, 52 },
1558 { 129, 1, 364, 52, 1, 53 },
1559 { 130, 2, 0, 0, 1, 0 },
1560 { 130, 3, 1, 0, 1, 0 },
1561 { 130, 4, 2, 0, 1, 0 },
1562 { 130, 5, 3, 0, 1, 0 },
1563 { 130, 6, 4, 0, 1, 0 },
1564 { 130, 0, 5, 1, 1, 0 },
1565 { 130, 1, 6, 1, 2, 1 },
1566 { 130, 2, 357, 51, 52, 51 },
1567 { 130, 3, 358, 51, 52, 51 },
1568 { 130, 4, 359, 51, 52, 51 },
1569 { 130, 5, 360, 51, 52, 51 },
1570 { 130, 6, 361, 51, 52, 51 },
1571 { 130, 0, 362, 52, 52, 51 },
1572 { 130, 1, 363, 52, 1, 52 },
1573 { 130, 2, 364, 52, 1, 52 },
1574 { 131, 3, 0, 0, 1, 0 },
1575 { 131, 4, 1, 0, 1, 0 },
1576 { 131, 5, 2, 0, 1, 0 },
1577 { 131, 6, 3, 0, 1, 0 },
1578 { 131, 0, 4, 1, 1, 0 },
1579 { 131, 1, 5, 1, 2, 1 },
1580 { 131, 2, 6, 1, 2, 1 },
1581 { 131, 3, 357, 51, 52, 51 },
1582 { 131, 4, 358, 51, 52, 51 },
1583 { 131, 5, 359, 51, 52, 51 },
1584 { 131, 6, 360, 51, 52, 51 },
1585 { 131, 0, 361, 52, 52, 51 },
1586 { 131, 1, 362, 52, 1, 52 },
1587 { 131, 2, 363, 52, 1, 52 },
1588 { 131, 3, 364, 52, 1, 52 },
1589 { 132, 4, 0, 0, 1, 0 },
1590 { 132, 5, 1, 0, 1, 0 },
1591 { 132, 6, 2, 0, 1, 0 },
1592 { 132, 0, 3, 1, 1, 0 },
1593 { 132, 1, 4, 1, 2, 1 },
1594 { 132, 2, 5, 1, 2, 1 },
1595 { 132, 3, 6, 1, 2, 1 },
1596 { 132, 5, 358, 51, 52, 51 },
1597 { 132, 6, 359, 51, 52, 51 },
1598 { 132, 0, 360, 52, 52, 51 },
1599 { 132, 1, 361, 52, 53, 52 },
1600 { 132, 2, 362, 52, 53, 52 },
1601 { 132, 3, 363, 52, 53, 52 },
1602 { 132, 4, 364, 52, 53, 52 },
1603 { 132, 5, 365, 52, 53, 52 },
1604 { 133, 6, 0, 0, 53, 0 },
1605 { 133, 0, 1, 1, 53, 0 },
1606 { 133, 1, 2, 1, 1, 1 },
1607 { 133, 2, 3, 1, 1, 1 },
1608 { 133, 3, 4, 1, 1, 1 },
1609 { 133, 4, 5, 1, 1, 1 },
1610 { 133, 5, 6, 1, 1, 1 },
1611 { 133, 6, 357, 51, 51, 51 },
1612 { 133, 0, 358, 52, 51, 51 },
1613 { 133, 1, 359, 52, 52, 52 },
1614 { 133, 2, 360, 52, 52, 52 },
1615 { 133, 3, 361, 52, 52, 52 },
1616 { 133, 4, 362, 52, 52, 52 },
1617 { 133, 5, 363, 52, 52, 52 },
1618 { 133, 6, 364, 52, 52, 52 },
1619 { 134, 0, 0, 1, 52, 0 },
1620 { 134, 1, 1, 1, 1, 1 },
1621 { 134, 2, 2, 1, 1, 1 },
1622 { 134, 3, 3, 1, 1, 1 },
1623 { 134, 4, 4, 1, 1, 1 },
1624 { 134, 5, 5, 1, 1, 1 },
1625 { 134, 6, 6, 1, 1, 1 },
1626 { 134, 0, 357, 52, 51, 51 },
1627 { 134, 1, 358, 52, 52, 52 },
1628 { 134, 2, 359, 52, 52, 52 },
1629 { 134, 3, 360, 52, 52, 52 },
1630 { 134, 4, 361, 52, 52, 52 },
1631 { 134, 5, 362, 52, 52, 52 },
1632 { 134, 6, 363, 52, 52, 52 },
1633 { 134, 0, 364, 53, 52, 52 },
1634 { 135, 1, 0, 0, 1, 1 },
1635 { 135, 2, 1, 0, 1, 1 },
1636 { 135, 3, 2, 0, 1, 1 },
1637 { 135, 4, 3, 0, 1, 1 },
1638 { 135, 5, 4, 0, 1, 1 },
1639 { 135, 6, 5, 0, 1, 1 },
1640 { 135, 0, 6, 1, 1, 1 },
1641 { 135, 1, 357, 51, 52, 52 },
1642 { 135, 2, 358, 51, 52, 52 },
1643 { 135, 3, 359, 51, 52, 52 },
1644 { 135, 4, 360, 51, 52, 52 },
1645 { 135, 5, 361, 51, 52, 52 },
1646 { 135, 6, 362, 51, 52, 52 },
1647 { 135, 0, 363, 52, 52, 52 },
1648 { 135, 1, 364, 52, 1, 53 },
1649 { 136, 2, 0, 0, 1, 0 },
1650 { 136, 3, 1, 0, 1, 0 },
1651 { 136, 4, 2, 0, 1, 0 },
1652 { 136, 5, 3, 0, 1, 0 },
1653 { 136, 6, 4, 0, 1, 0 },
1654 { 136, 0, 5, 1, 1, 0 },
1655 { 136, 1, 6, 1, 2, 1 },
1656 { 136, 3, 358, 51, 52, 51 },
1657 { 136, 4, 359, 51, 52, 51 },
1658 { 136, 5, 360, 51, 52, 51 },
1659 { 136, 6, 361, 51, 52, 51 },
1660 { 136, 0, 362, 52, 52, 51 },
1661 { 136, 1, 363, 52, 1, 52 },
1662 { 136, 2, 364, 52, 1, 52 },
1663 { 136, 3, 365, 52, 1, 52 },
1664 { 137, 4, 0, 0, 1, 0 },
1665 { 137, 5, 1, 0, 1, 0 },
1666 { 137, 6, 2, 0, 1, 0 },
1667 { 137, 0, 3, 1, 1, 0 },
1668 { 137, 1, 4, 1, 2, 1 },
1669 { 137, 2, 5, 1, 2, 1 },
1670 { 137, 3, 6, 1, 2, 1 },
1671 { 137, 4, 357, 51, 52, 51 },
1672 { 137, 5, 358, 51, 52, 51 },
1673 { 137, 6, 359, 51, 52, 51 },
1674 { 137, 0, 360, 52, 52, 51 },
1675 { 137, 1, 361, 52, 53, 52 },
1676 { 137, 2, 362, 52, 53, 52 },
1677 { 137, 3, 363, 52, 53, 52 },
1678 { 137, 4, 364, 52, 53, 52 },
1679 };
1680
1681 static int test_week_calc( void )
1682 {
1683     char buffer[100];
1684     int rc = 1;
1685     for ( int i = 0; i < 1020; ++i )
1686     {
1687         struct tm t = { 0 };
1688         t.tm_year = data[i][0];
1689         t.tm_wday = data[i][1];
1690         t.tm_yday = data[i][2];
1691         assert( strftime( buffer, 100, "%U %V %W", &t ) == 8 );
1692         int U, V, W;
1693         assert( sscanf( buffer, "%d %d %d", &U, &V, &W ) == 3 );
1694         if ( data[i][3] != U || data[i][4] != V || data[i][5] != W )
1695         {
1696             printf( "Fehler in { %d, %d, %d, %d, %d, %d } (encountered { %d, %d, %d })\n", data[i][0], data[i][1], data[i][2], data[i][3], data[i][4], data[i][5], U, V, W );
1697             rc = 0;
1698         }
1699     }
1700     return rc;
1701 }
1702
1703 int main( void )
1704 {
1705     char buffer[100];
1706     /* Basic functionality */
1707     struct tm timeptr;
1708     MKTIME( timeptr, 59, 30, 12, 1, 9, 72, 0, 274 );
1709     TESTCASE( strftime( buffer, 100, "%a ", &timeptr ) == 4 );
1710     TESTCASE( strcmp( buffer, "Sun " ) == 0 );
1711     TESTCASE( strftime( buffer, 100, "%A ", &timeptr ) == 7 );
1712     TESTCASE( strcmp( buffer, "Sunday " ) == 0 );
1713     TESTCASE( strftime( buffer, 100, "%b ", &timeptr ) == 4 );
1714     TESTCASE( strcmp( buffer, "Oct " ) == 0 );
1715     TESTCASE( strftime( buffer, 100, "%h ", &timeptr ) == 4 );
1716     TESTCASE( strcmp( buffer, "Oct " ) == 0 );
1717     TESTCASE( strftime( buffer, 100, "%B ", &timeptr ) == 8 );
1718     TESTCASE( strcmp( buffer, "October " ) == 0 );
1719     TESTCASE( strftime( buffer, 100, "%c ", &timeptr ) == 25 );
1720     TESTCASE( strcmp( buffer, "Sun Oct  1 12:30:59 1972 " ) == 0 );
1721     TESTCASE( strftime( buffer, 100, "%C ", &timeptr ) == 3 );
1722     TESTCASE( strcmp( buffer, "19 " ) == 0 );
1723     TESTCASE( strftime( buffer, 100, "%d ", &timeptr ) == 3 );
1724     TESTCASE( strcmp( buffer, "01 " ) == 0 );
1725     TESTCASE( strftime( buffer, 100, "%D ", &timeptr ) == 9 );
1726     TESTCASE( strcmp( buffer, "10/01/72 " ) == 0 );
1727     TESTCASE( strftime( buffer, 100, "%e ", &timeptr ) == 3 );
1728     TESTCASE( strcmp( buffer, " 1 " ) == 0 );
1729     TESTCASE( strftime( buffer, 100, "%F ", &timeptr ) == 11 );
1730     TESTCASE( strcmp( buffer, "1972-10-01 " ) == 0 );
1731     TESTCASE( strftime( buffer, 100, "%H ", &timeptr ) == 3 );
1732     TESTCASE( strcmp( buffer, "12 " ) == 0 );
1733     TESTCASE( strftime( buffer, 100, "%I ", &timeptr ) == 3 );
1734     TESTCASE( strcmp( buffer, "12 " ) == 0 );
1735     TESTCASE( strftime( buffer, 100, "%j ", &timeptr ) == 4 );
1736     TESTCASE( strcmp( buffer, "275 " ) == 0 );
1737     TESTCASE( strftime( buffer, 100, "%m ", &timeptr ) == 3 );
1738     TESTCASE( strcmp( buffer, "10 " ) == 0 );
1739     TESTCASE( strftime( buffer, 100, "%M ", &timeptr ) == 3 );
1740     TESTCASE( strcmp( buffer, "30 " ) == 0 );
1741     TESTCASE( strftime( buffer, 100, "%p ", &timeptr ) == 3 );
1742     TESTCASE( strcmp( buffer, "PM " ) == 0 );
1743     TESTCASE( strftime( buffer, 100, "%r ", &timeptr ) == 12 );
1744     TESTCASE( strcmp( buffer, "12:30:59 PM " ) == 0 );
1745     TESTCASE( strftime( buffer, 100, "%R ", &timeptr ) == 6 );
1746     TESTCASE( strcmp( buffer, "12:30 " ) == 0 );
1747     TESTCASE( strftime( buffer, 100, "%S ", &timeptr ) == 3 );
1748     TESTCASE( strcmp( buffer, "59 " ) == 0 );
1749     TESTCASE( strftime( buffer, 100, "%T ", &timeptr ) == 9 );
1750     TESTCASE( strcmp( buffer, "12:30:59 " ) == 0 );
1751     TESTCASE( strftime( buffer, 100, "%u ", &timeptr ) == 2 );
1752     TESTCASE( strcmp( buffer, "7 " ) == 0 );
1753     TESTCASE( strftime( buffer, 100, "%w ", &timeptr ) == 2 );
1754     TESTCASE( strcmp( buffer, "0 " ) == 0 );
1755     TESTCASE( strftime( buffer, 100, "%x ", &timeptr ) == 9 );
1756     TESTCASE( strcmp( buffer, "10/01/72 " ) == 0 );
1757     TESTCASE( strftime( buffer, 100, "%X ", &timeptr ) == 9 );
1758     TESTCASE( strcmp( buffer, "12:30:59 " ) == 0 );
1759     TESTCASE( strftime( buffer, 100, "%y ", &timeptr ) == 3 );
1760     TESTCASE( strcmp( buffer, "72 " ) == 0 );
1761     TESTCASE( strftime( buffer, 100, "%Y ", &timeptr ) == 5 );
1762     TESTCASE( strcmp( buffer, "1972 " ) == 0 );
1763     TESTCASE( strftime( buffer, 100, "%% ", &timeptr ) == 2 );
1764     TESTCASE( strcmp( buffer, "% " ) == 0 );
1765     TESTCASE( strftime( buffer, 100, "%n ", &timeptr ) == 2 );
1766     TESTCASE( strcmp( buffer, "\n " ) == 0 );
1767     TESTCASE( strftime( buffer, 100, "%t ", &timeptr ) == 2 );
1768     TESTCASE( strcmp( buffer, "\t " ) == 0 );
1769     TESTCASE( test_week_calc() );
1770     return TEST_RESULTS;
1771 }
1772
1773 #endif