-
Notifications
You must be signed in to change notification settings - Fork 5
/
lang0.json
750 lines (750 loc) · 207 KB
/
lang0.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
{
"1_1001": [
"#include <stdio.h>\n\nint main()\n{\n int a,b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"//http://acm.ut.ac.i\n//prob A+B\n//1001\n#include <stdio.h>\nint main()\n{\n int a,b;\n while(scanf(\"%d%d\",&a,&b)!=EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}\n",
"#include <stdio.h>\nint main()\n{\n int a,b;\n while( scanf(\"%d%d\",&a,&b)==2 )\n printf(\"%d\\n\",a+b);\n}\n",
"#include <stdio.h>\nint main()\n{\nint a,b=0;\nwhile(scanf(\"%d%d\",&a,&b)==2)\n printf(\"%d\\n\",a+b);\n}",
"#include <stdio.h>\n\nint main(void) {\n\tint a, b;\n\n\twhile (scanf(\"%d%d\", &a, &b) != EOF) {\n\t\tprintf(\"%d\\n\", a + b);\n\t}\n\n\treturn 0;\n}",
"#include <stdio.h>\n\nint main()\n{\n\tchar S[100];\n\n\tdo{\n\t\tlong int a,b;\n\t\tS[0]='\\0';\n\t\tgets(S);\n\t\tif(S[0]=='\\0')\n\t\t\tbreak;\n\t\tsscanf(S, \"%li %li\",&a,&b);\n\t\tprintf(\"%li\\n\",a+b);\n\t} while(S[0]!='\\0');\n\n\treturn 0;\n}\n",
"main(){\n int a,b;\n while( scanf(\"%d%d\",&a,&b)>0)\n printf(\"%d\\n\",a+b);\n}\n",
"main()\n{\n int a,b;\n while( scanf(\"%d%d\",&a,&b)>1 )\n printf(\"%d\\n\",a+b);\n}\n",
"#include<stdio.h>\na,b;main(){scanf(\"%d %d\",&a,&b)+1?printf(\"%d\\n\",a+b),main():0;}",
"a,b;main(){scanf(\"%d %d\",&a,&b)+1?printf(\"%d\\n\",a+b),main():0;}",
"main(a,b){scanf(\"%d %d\",&a,&b)+1?printf(\"%d\\n\",a+b),main():0;}",
"main(a,b){for(;scanf(\"%d%d\",&a,&b)+1;)printf(\"%d\\n\",a+b);}",
"main()\n{\nfor(int a,b;scanf(\"%d%d\",&a,&b)>1;printf(\"%d\\n\",a+b));\n}\n",
"main(a,b)\n{\nfor(;scanf(\"%d%d\",&a,&b)>1;printf(\"%d\\n\",a+b));\n}\n",
"main(a,b){for(;scanf(\"%d%d\",&a,&b)>=0;printf(\"%d\\n\",a+b));}",
"main(a,b){for(;scanf(\"%d%d\",&a,&b)>1;printf(\"%d\\n\",a+b));}",
"main(a,b){for(;~scanf(\"%d%d\",&a,&b);)printf(\"%d\\n\",a+b);}",
"#include <stdio.h> \nmain(){int a,b; while(scanf(\"%d%d\",&a,&b)!=EOF) printf(\"%d\\n\" ,a+b);}",
"#include <stdio.h>\nint main()\n{\n int a,b;\n while (scanf(\"%d%d\",&a,&b)>0)\n printf(\"%d\\n\",a+b);\n}",
"#include <stdio.h>\n\nint main() {\n\tint a, b;\n\twhile (scanf(\"%d %d\", &a, &b) != EOF) {\n\t\tprintf(\"%d\\n\", a + b);\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n\nint main()\n{\n int a, b;\n while( scanf(\"%d %d\", &a, &b) != EOF )\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"#include <stdio.h>\n\nint main()\n{\n int a,b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"#include<stdio.h>\n\n\nint main()\n{\n\t\tint a,b;\n\n\t\twhile((scanf(\"%d %d\",&a,&b))==2)\n\t\t\tprintf(\"%d\\n\",a+b);\n\n\t\treturn 0;\n}",
"#include <stdio.h>\n\nint main(){\n\tint a, b;\n\tlong sum;\n\twhile(scanf(\"%d %d\\n\", &a, &b) == 2){\n\t\tsum = a;\n\t\tsum += b;\n\t\tprintf(\"%ld\\n\", sum);\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n\nint main(){\nint a, b;\nlong sum;\nwhile(scanf(\"%d %d\\n\", &a, &b) == 2){\nsum = a;\nsum += b;\nprintf(\"%ld\\n\", sum);\n}\nreturn 0;\n}",
"#include<stdio.h>\nint main(){\nint a,b,c;\nwhile(scanf(\"%d%d\",&a,&b)!=EOF){\n\tc=a+b;\n\tprintf(\"%d\\n\",c);\n}\n\n\nreturn 0;}",
"#include<stdio.h>\nint main(){\nint a,b,c;\nwhile(scanf(\"%d%d\",&a,&b)!=EOF){\n\tc=a+b;\n\tprintf(\"%d\\n\",c);\n}\n\n\nreturn 0;}",
"#include <stdio.h>\n\nint main() {\n int a,b;\n while(scanf(\"%d %d\\n\", &a, &b)!=EOF) {\n printf(\"%d\\n\", a + b);\n }\n return 0;\n}\n",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint a,b;\n\n\twhile(1)\n\t{\n\t\tscanf(\"%d%d\", &a, &b);\n\t\tif(feof(stdin))\n\t\t\tbreak;\n\t\tprintf(\"%d\\n\", a+b);\n\t} \n\n\treturn 0;\n}",
"#include<stdio.h>\n#include<stdlib.h>\nint main(int argc, const char * argv[])\n{\n int a,b;\n while(1){\n scanf(\"%d\",&a);\n scanf(\"%d\",&b);\n if(feof(stdin))\n break;\n printf(\"%d\\n\",a+b);\n \n }\n \n}",
"#include <stdio.h>\nint main(){\n int a,b, sum;\n\n while (scanf(\"%d%d\", &a, &b) != EOF)\n {\n sum = a + b;\n printf(\"%d\\n\", sum );\n }\n return 0;\n}\n",
"#include <stdio.h>\n\nmain() {\n\tint a, b;\n\tint sum[100];\n\tint i,j;\n\tchar c;\n\t\n\tfor(i=0; i<100; i++) sum[i]=0;\n\t\n\ti=0;\n\tdo {\n\t\tscanf(\"%d %d\", &a, &b);\n\t\tsum[i]=a+b;\n\t\ti++;\n\t} while((c=getchar())!=EOF);\n\t\n\tfor(j=0; j<i-1; j++) printf(\"%d\\n\", sum[j]);\n}\n",
"#include <stdio.h>\n\nmain() {\n\tint a, b;\n\tint sum[100];\n\tint i,j;\n\tchar c;\n\t\n\tfor(i=0; i<100; i++) sum[i]=0;\n\t\n\ti=0;\n\twhile (scanf(\"%d %d\", &a, &b) == 2) {\n\t\tsum[i]=a+b;\n\t\ti++;\n } \n\tfor(j=0; j<i; j++) printf(\"%d\\n\", sum[j]);\n}\n",
"#include <stdio.h>\n\nint main(){\n\tint a , b;\n\twhile(scanf(\"%d%d\",&a,&b) != EOF){\n\t\tprintf(\"%d\\n\",a+b);\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n\nint main(){\n\tint a , b;\n\twhile(scanf(\"%d%d\",&a,&b) != EOF){\n\t\tprintf(\"%d\\n\",a+b);\n\t}\n\treturn 1;\n}",
"#include <stdio.h>\n\nint main(){\n\tint a , b;\n\twhile(scanf(\"%d%d\",&a,&b) != EOF){\n\t\tprintf(\"%d\\n\",a+b);\n\t}\n}",
"#include <stdio.h>\n\nint main()\n{\n int a,b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
" #include <stdio.h>\n int main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n }",
"#include <stdio.h>\nint main()\n{\n int b=0,a=0;\n \n while(scanf(\"%d %d\",&b,&a)!= EOF){ \n printf(\"%d\\n\",a+b);\n }\n return 0;\n}\n",
"#include <stdio.h>\nint main()\n{\nint a,b;\nwhile (scanf(\"%d %d\",&a,&b) != -1)\nprintf(\"%d\\n\",a+b);\n}",
"main()\n{\n\tint a,b;\n\twhile(scanf(\"%d%d\",&a,&b)+1)printf(\"%d\\n\",a+b);\t\t \n}",
"main()\n{\nint a, b;\nwhile (scanf(\"%d%d\",&a,&b)+1)printf(\"%d\\n\",a+b);\n}",
"main()\n{\n\tfor(int a,b;scanf(\"%d%d\",&a,&b)+1;)printf(\"%d\\n\",a+b);\n}",
"main(a,b)\n{\n\tfor(;scanf(\"%d%d\",&a,&b)+1;printf(\"%d\\n\",a+b));\n}",
"main()\n{\n\tint a,b;\nwhile(~scanf(\"%d%d\",&a,&b)) printf(\"%d\\n\",a+b);\n}",
"main()\n{\n\tint a,b;\nwhile(~scanf(\"%d%d\",&a,&b)) printf(\"%d\\n\",a+b);\n}",
"main(){\n\tint a,b;\n\twhile(~scanf(\"%d%d\",&a,&b))printf(\"%d\\n\",a+b);\t\t \n}",
"main(a,b){\n while(~scanf(\"%d%d\",&a,&b))printf(\"%d\\n\",a+b); \n}",
"main(a, b)\n{\n\nwhile(~scanf(\"%d%d\",&a,&b)) printf(\"%d\\n\",a+b);\n}",
"main(a,b)\n{\n\tfor(;~scanf(\"%d%d\",&a,&b);printf(\"%d\\n\",a+b));\n}",
"#include <stdio.h>\n\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"main(a,b){\n while(~scanf(\"%d%d\",&a,&b))printf(\"%d\\n\",a+b);\n return -64553445;\n}",
"#include <stdio.h>\nint main()\n{\n\n int a,b;\n while(2==scanf(\"%d %d\",&a, &b))\n\t{\n printf(\"%d\\n\",a+b);\n\t}\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != -1)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"main()\n{\n int a, b;\n while(scanf(\"%d %d\", &a, &b) + 1){\n printf(\"%d\\n\", a+b);\n }\n}",
"main()\n{\n int a, b;\n while(~scanf(\"%d %d\", &a, &b)){\n printf(\"%d\\n\", a+b);\n }\n}",
"#include <stdio.h>\n\nmain(){\n\tint a,b;\n\twhile(scanf(\"%d %d\", &a, &b) != EOF)\n\t\tprintf(\"%d\\n\", a+b);\n}",
"#include <stdio.h>\n\nint main(){\n\tint a,b;\n\twhile(scanf(\"%d %d\",&a,&b)!=EOF){\n\t\tprintf(\"%d\\n\",a+b);\n\t}\n\treturn 0;\n}",
"main(a,b){for(;~scanf(\"%d%d\",&a,&b);printf(\"%d\\n\",a+b));}",
"#include <stdio.h>\nint main()\n{\t\n\tint a , b;\n\twhile(scanf(\"%d %d\",&a,&b)!=EOF)\n\t\tprintf(\"%d\\n\",a+b);\n\treturn 0;\n}",
"#include<stdio.h>\nint main(){int a,b;while(scanf(\"%d%d\",&a,&b)!=EOF)printf(\"%d\\n\",a+b);return 0;}",
"#include<stdio.h>\nint main()\n{\n int a;\n int b;\n while(scanf(\"%d %d\",&a,&b) !=EOF)\n {\n printf(\"%d\\n\",a + b);\n }\n return 0;\n}",
"#include <stdio.h>\n\nint main() {\n int a, b;\n while(scanf(\"%d %d\", &a, &b) == 2) {\n printf(\"%d\\n\", a+b);\n }\n return 0;\n}\n",
"#include <stdio.h>\nvoid main()\n{\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n}",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a,&b)!= EOF)\n printf(\"%d\\n\",a + b);\n return 0;\n}",
"main(a, b)\n{\n\tfor (; ~scanf(\"%d%d\", &a, &b); printf(\"%d\\n\", a + b));\n}",
"main(x,y){\nfor(;scanf(\"%d%d\",&x,&y)==2;printf(\"%d\\n\",x+y));\n}/////////////////////////////",
"main(x,y){\nfor(;scanf(\"%d%d\",&x,&y)==2;printf(\"%d\\n\",x+y));\n}",
"#include <stdio.h>\nint main()\n{\n int a;\n int b;\nwhile (scanf(\"%d %d\" ,&a ,&b)!= EOF)\n{\n printf(\"%d\\n\" ,a+b);\n}\n\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}\n",
"#include <stdio.h>\nint main()\n{\n\tint a,b;\n\twhile(scanf(\"%d %d\",&a,&b) != EOF)\n\t{\n\t\tprintf(\"%d\\n\",a+b);\n\t\t\n\t}\n\t\n\treturn 0;\n}",
"main(a,b){for(;~scanf(\"%d%d\",&a,&b);printf(\"%d\\n\",a+b));}\n// Salam saboori! :D\n// Inam pass:\n// e5289Ba3",
"// The Piker | sharecode - prob. 1\n#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"#include \"stdio.h\"\n\nint main() {\n\tint a, b;\n\n\twhile (scanf(\"%d%d\", &a, &b) != EOF)\n\t\tprintf(\"%d\\n\", a + b);\n\n\treturn 0;\n}",
"#define _POSIX_C_SOURCE 200809L\n\n#include <stdio.h>\n#include <stdbool.h>\n#include <stdlib.h>\n\nstruct problem {\n int a, b;\n};\n\nbool get_problem (struct problem *p) {\n\n bool success = false;\n char *line = NULL;\n size_t len = 0;\n ssize_t read;\n\n read = getline(&line, &len, stdin);\n if (read > 2 && sscanf(line, \"%d %d\", &p->a, &p->b) == 2) {\n success = true;\n }\n\n free(line);\n return success;\n}\n\n\nint main (int argc, char *argv[]) {\n\n struct problem p;\n while (get_problem(&p)) {\n printf(\"%d\\n\", p.a + p.b);\n }\n\n return EXIT_SUCCESS;\n}\n",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}",
"#include<stdio.h>\nvoid main()\n{\nint a,b;\nwhile(scanf(\"%d %d\",&a,&b)!=EOF)\n {\n \nprintf(\"%d\\n\",a+b);\n }\n}\n",
"#include<stdio.h>\nint main()\n{\n int a, b;\n do\n {\n scanf(\"%d%d\", &a, &b);\n if(!feof(stdin))\n printf(\"%d\\n\", a + b);\n } while (!feof(stdin));\n return 0;\n}",
"#include<stdio.h>\n\nint main(){\n int a, b;\n while( scanf(\"%d %d\", &a, &b) != EOF ){\n printf(\"%d\\n\", a + b);\n }\n return 0;\n}",
"#include <stdio.h>\n\nint main() {\n\tint a, b;\n\n\twhile (scanf(\"%d %d\", &a, &b) != EOF) {\n\t\tprintf(\"%d\\n\", a+b);\n\t}\n\n\treturn 0;\n}",
"#include <stdio.h>\nint main(){int a,b;while(scanf(\"%d %d\",&a,&b)!=EOF){printf(\"%d\\n\", a+b);}return 0;}",
"#include <stdio.h>\nvoid main(){int a,b;while(scanf(\"%d %d\",&a,&b)!=EOF){printf(\"%d\\n\", a+b);}}",
"#include <stdio.h>\nint main()\n{\n int a, b;\n while (scanf(\"%d%d\", &a, &b)==2)\n {\n printf(\"%d\\n\", a+b);\n }\n return 0;\n}",
"#include<stdio.h>\n\nint main(){\n int a, b;\n while( scanf(\"%d %d\", &a, &b) != EOF ){\n printf(\"%d\\n\", a + b);\n }\n return 0;\n}",
"#include <stdio.h>\n\nint main()\n{\n\tint a,b;\n\twhile (scanf(\"%d %d\",&a,&b) != EOF)\n\t\tprintf(\"%d\\n\",a+b);\n\treturn 0;\n}",
"int main(){int a,b;while(scanf(\"%d %d\",&a,&b)>0)printf(\"%d\\n\",a+b);}",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}\n",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%i %i\",&a, &b) != EOF)\n printf(\"%i\\n\",a+b);\n return 0;\n}\n",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%i %i\",&a, &b)!= EOF) printf(\"%i\\n\",a+b);\n return 0;\n}",
"#include <stdio.h>\nvoid main(){int a,b;while(scanf(\"%i %i\",&a,&b)!=EOF)printf(\"%i\\n\",a+b);}",
"#include <stdio.h>\nint main(){for(int a,b;scanf(\"%d %d\",&a,&b)>0;printf(\"%d\\n\",a+b));}",
"#include <stdio.h>\nint main()\n{\n int x,y;\n while (scanf(\"%d %d\",&x,&y)!=EOF)\n {\n printf(\"%d\\n\",x+y);\n }\n return 0;\n}\n",
"#include <stdio.h>\nint main(){\n int a,b;\n while (scanf(\"%d%d\",&a,&b) != EOF){\n printf(\"%d\\n\",a+b);\n }\n\n}\n",
"#include<stdio.h>\nint main ()\n{\n int a,b;\n\n scanf(\"%d%d\", &a, &b);\n while(a != -999)\n {\n\n printf(\"%d\", a+b);\n printf(\"\\n\");\n a = -999;\n scanf(\"%d%d\", &a, &b);\n\n }\n\n\n}",
"#include<stdio.h>\nint main(){\n int a,b;\n while(scanf(\"%d%d\",&a,&b)!=-1){\n printf(\"%d\\n\",a+b);\n }\n}\n",
"void main()\n{\n int a,b;\n while (scanf(\"%d %d\",&a, &b) == 2) {\n printf(\"%d\\n\",a+b);\n }\n}",
"#include<stdio.h>\nint main(){\n\tint a,b;\n\t while(scanf(\"%d%d\",&a,&b)!=EOF){\n\t \tprintf(\"%d\\n\",a+b);\n\t }\n}",
"#include<stdio.h>\nint main(){\n\tint a,b;\n\t while(scanf(\"%d%d\",&a,&b)!=EOF){\n\t \tprintf(\"%d\\n\",a+b);\n\t }\n}",
"#include<stdio.h>\nint main()\n{\n int a,b;\n while(1)\n {\n int x1 = scanf(\"%d\",&a);\n int x2 = scanf(\"%d\",&b);\n if(x1==1 && x2==1)\n printf(\"%d\\n\",a+b);\n else\n break;\n }\n return 0;\n}",
"#include <stdio.h>\nint main(){\nint a,b;\nwhile(scanf(\"%d %d\",&a, &b) != EOF)\nprintf(\"%d\\n\",a+b);\n}",
"#include <stdio.h>\nint main(void){\n int a, b;\n while(scanf(\"%d %d\", &a, &b) != EOF)\n printf(\"%d\\n\", a+b);\n return 0;\n}",
"#include <stdio.h>\nint main(){\n int a, b;\n while(scanf(\"%d %d\", &a, &b) != EOF)\n printf(\"%d\\n\", a+b);\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int a, b;\n while(scanf(\"%d %d\",&a, &b) != EOF)\n printf(\"%d\\n\",a+b);\n return 0;\n}"
],
"1_1006": [
"main(){float a,b;for(;b=scanf(\"%f\",&a),a;printf(\"%g card(s)\\n\",b-1))for(;a>0;a-=1/++b);}",
"main(){float t,i;for(;i=scanf(\"%f\",&t),t;printf(\"%g card(s)\\n\",i-1))for(;t>0;t-=1/++i);}",
"#include<stdio.h>\nint main(){float d,h;while(scanf(\"%f\",&d)&&d){h=0;int i=1;while(h <= d*d)h += d/(++i);printf(\"%d card(s)\\n\", i-1);}}",
"main(){for(float n,i;scanf(\"%f\",&n),n;printf(\"%g card(s)\\n\",i-2))for(i=2;n>0;n-=1/i++);}",
"main(){for(float n,i;i=scanf(\"%f\",&n),n;printf(\"%g card(s)\\n\",i-1))for(;n>0;n-=1/++i);}",
"\nmain(){for(float t,i;i=scanf(\"%f\",&t),t;printf(\"%g card(s)\\n\",i-1))for(;t>0;t-=1/++i);}",
"main(){for(float a,b;b=scanf(\"%f\",&a),a;printf(\"%g card(s)\\n\",b-1))for(;a>0;a-=1/++b);}",
"float x;\nmain(i)\n{\n\tfor(;x>0||(i=scanf(\"%f\",&x)&&x);x-=1.f/++i,(x>0?0:printf(\"%d card(s)\\n\",i-1)));\n}\n",
"float x;\nmain(i)\n{\nfor(;i=x>0?i:scanf(\"%f\",&x)&&x;(x-=1.f/++i)>0?0:printf(\"%d card(s)\\n\",i-1));\n}\n",
"float x,i;\nmain()\n{\nfor(;i=scanf(\"%f\",&x),x;printf(\"%g card(s)\\n\",--i))for(;x>0;x-=1/++i);\n}\n",
"main()\n{\nfor(float x,i;i=scanf(\"%f\",&x),x;printf(\"%g card(s)\\n\",--i))for(;x>0;x-=1/++i);\n}\n",
"main(i){for(float x;i=scanf(\"%f\",&x),x;printf(\"%d card(s)\\n\",--i))for(;x>0;x-=1./++i);}",
"main(n)\n{\n float i;\n for(scanf(\"%f\",&i);i>0;i-=1./++n);\n if (--n) printf(\"%d card(s)\\n\",n), main(1);\n}",
"float x,i;main(){for(;i=x<=0?i&&printf(\"%g card(s)\\n\",--i),scanf(\"%f\",&x):i,x;x-=1/++i);}",
"#include <stdio.h>\n#include <stdlib.h>\n\nint calculate( double length )\n{\n int i;\n double sum = 0.0;\n for ( i = 2; ; ++i )\n {\n sum += 1.0 / i;\n if ( sum >= length )\n break;\n }\n return i - 1;\n}\n\nint main()\n{\n double c;\n while ( 1 )\n {\n scanf( \"%lf\", &c );\n if ( c == 0.0 )\n break;\n printf( \"%d card(s)\\n\", calculate( c ) );\n }\n return EXIT_SUCCESS;\n}\n",
"main()\n{\t\n\tfor(float x,i;scanf(\"%f\",&x) && x;printf(\"%d card(s)\\n\",(int)i-2))\n\t\tfor(i=2;x>0;x-=1/i++);\n}",
"#include <stdio.h>\n\nint main()\n{\n\tdouble length, sum, i;\n\twhile(1)\n\t{\n\t\tscanf(\"%lf\", &length);\n\t\tif(length==0.00)\n\t\t\tbreak;\n\n\t\tsum=0.0;\n\t\ti=2;\n\t\twhile(sum<length)\n\t\t{\n\t\t\tsum += 1/i;\n\t\t\ti++;\n\t\t}\n\t\tprintf(\"%1.0f card(s)\\n\", i-2);\n\t}\n\treturn 0;\n}",
"#include<stdio.h>\n#include<math.h>\nint main()\n{\n \n while(1){\n double x,sum=0;\n double counter=2;\n\n \n scanf(\"%lf\" , &x);\n while(x>sum){\n sum=sum+(1/(counter));\n counter++;\n }\n sum=0;\n if(x==0.00) break;\n\n printf(\"%.0lf card(s)\\n\", counter-2);\n\n }\n}",
"#include <stdio.h>\n\n\nfloat i;\nint main() {\n\tif (scanf(\"%f\",&i),i==0) return 0;\n\tint n=2;\n\tfor(; i>0 ;) i-=1./n++;\n printf(\"%d card(s)\\n\",n-2);\n\tmain();\n}",
"#include <stdio.h>\nint main(){\n\tint i,n=1;\n\tfloat x=1,sum,y;\nwhile(n){\nscanf(\"%f\",&y);\n\nif(y!=0){\n\t\ti=2;\n\t\tsum=0;\n\t\tx=1;\n\t\twhile(1){\n\t\tsum+=x/i;\n\t\ti++;\n\t\tif(sum>y){\n\t\t\tprintf(\"%d card(s)\\n\",i-2);\n\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\telse{\n\t\tn=0;\n\t}\t\n\t}\n}\n",
"#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<math.h>\n\nint main()\n{\n \n int i,j,k;\n float len,sum=0;\n\n while(1)\n {\n scanf(\"%f\",&len);\n if(len==0.00) break;\n sum=0;\n i=2;\n while(1)\n {\n \n sum=sum+(float)1/(i);\n if(sum>=len) break;\n ++i;\n } \n printf(\"%d card(s)\\n\",i-1);\n\n }\n\nreturn 0;\n}",
"#include<stdio.h>\nint main (){\nint i;\nfloat n=0,l ;\nwhile(scanf(\"%4f\",&l)!= EOF){\nn=0;\nif (l>=0.01 && l<=5.20){\nfor (i=2;n<l;i++ ){\nn+=1.0/i ;\n}\ni-=2;\nprintf(\"%d card(s)\\n\",i);\n}}\nreturn 0;\n}",
"main(n)\n{\n float i;\n for(scanf(\"%f\",&i);i>0;i-=1./++n);\n if (--n) printf(\"%d card(s)\\n\",n), main(1);\n}",
"#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<math.h>\n\nint main()\n{\n \n int i,j,k;\n float len,sum=0;\n\n while(1)\n {\n scanf(\"%f\",&len);\n if(len==0.00) break;\n sum=0;\n i=2;\n while(1)\n {\n \n sum=sum+(float)1/(i);\n if(sum>=len) break;\n ++i;\n } \n printf(\"%d card(s)\\n\",i-1);\n\n }\n\nreturn 0;\n}",
"#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<math.h>\n\nint main()\n{\n \n int i,j,k;\n float len,sum=0;\n\n while(1)\n {\n scanf(\"%f\",&len);\n if(len==0.00) break;\n sum=0;\n i=2;\n while(1)\n {\n \n sum=sum+(float)1/(i);\n if(sum>=len) break;\n ++i;\n } \n printf(\"%d card(s)\\n\",i-1);\n\n }\n\nreturn 0;\n}",
"#include<stdio.h>\n\nint main()\n{\n\tfloat a[300] , temp;\n\tint j =0 , i,z;\n\n\twhile (1)\n\t{\n\t\tscanf(\"%f\", &a[j] );\n\t\tif(a[j]==0.00)\n\t\t\tbreak;\n\t\tj++;\n\t}\n\n\tfor (i = 0; i < j; i++)\n\t{\n\t\ttemp = 0;\n\t\tfor (z = 1; z < 500; z++)\n\t\t{\n\t\t\ttemp = temp + (1./(z+1));\n\t\t\tif(temp >= a[i] )\n\t\t\t\tbreak;\n\t\t}\n\t\tprintf(\"%d card(s)\\n\",z);\n\t}\n}",
"#include<stdio.h>\nmain(){\n\tfloat len;\n\tfloat sum=0;\n\tint i=1;\n\tscanf(\"%f\",&len);\n\twhile((len>0.00) && (len<=5.20)){\n\t\twhile(sum<len){\n\t\t\ti++;\n\t\t\tsum+=1/(i*1.00);\n\t\t}\n\t\ti--;\n\t\tprintf(\"%d card(s)\\n\",i);\n\t\ti=1;\n\t\tsum=0;\n\t\tscanf(\"%f\",&len);\t\n\t}\t\n}\n",
" #include <stdio.h>\n int main() {\n float x,sum,i;\n //freopen(\"input.txt\",\"r\",stdin);\n //while(scanf(\"%f\",&x) != EOF)\n scanf(\"%f\",&x);\n while(x>0){\n sum=0;\n i=2;\n while(sum<x){\n \tsum+=1/i++;\n \t//printf(\"%f\\n\",sum);\n }\n printf(\"%.0f card(s)\\n\",i-2);\n scanf(\"%f\",&x);\n\t}\n return 0;\n }",
"#include <stdio.h>\nmain(){\nfloat x,y,z;\nfor(;scanf(\"%f\",&x)&&x>0.01;)\n{\nfor(y=0,z=2;y<=x;y+=1/z,z++);\nprintf(\"%.0f card(s)\\n\", z-2);\n}\n}",
"main(){\nfor(float x,y=0,z=1;scanf(\"%f\",&x)&&x;){for(y=0,z=1;y<=x;y+=1/(++z));printf(\"%.0f card(s)\\n\", z-1);}\n}",
"#include <stdio.h>\nint main(){\n int i;\n double d,in;\n while(scanf(\"%lf\",&in)){\n if(in==0)break;\n d=0;\n i=2;\n while(d<in){\n d+=(double)1/i;\n i++;\n }\n printf(\"%d card(s)\\n\",i-2);\n }\n return 0;\n}\n",
"#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<math.h>\n\nint main()\n{\n \n int i,j,k;\n float len,sum=0;\n\n while(1)\n {\n scanf(\"%f\",&len);\n if(len==0.00) break;\n sum=0;\n i=2;\n while(1)\n {\n \n sum=sum+(float)1/(i);\n if(sum>=len) break;\n ++i;\n } \n printf(\"%d card(s)\\n\",i-1);\n\n }\n\nreturn 0;\n}",
"#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<math.h>\n\nint main()\n{\n \n int i,j,k;\n float len,sum=0;\n\n while(1)\n {\n scanf(\"%f\",&len);\n if(len==0.00) break;\n sum=0;\n i=2;\n while(1)\n {\n \n sum=sum+(float)1/(i);\n if(sum>=len) break;\n ++i;\n } \n printf(\"%d card(s)\\n\",i-1);\n\n }\n\nreturn 0;\n}",
"#define S scanf(\"%f\",&a)\nmain(i)\n{\n\tfloat a, s;\t\n\tfor( S;a;printf(\"%d card(s)\\n\",i), S )\t\n\t\tfor(s = i = 0; s < a; )\n\t\t\ts += 1. / (i++ + 2);\n}",
"main(i)\n{\n\tfloat a,s;\n\tfor(;scanf(\"%f\",&a) && a; printf(\"%d card(s)\\n\",i-2))\t\t\n\t\tfor(s=i=2; s -2< a; )\n\t\t\ts += 1. / i++;\n}",
"main(i)\n{\n\tfloat a,s;\n\tfor(;scanf(\"%f\",&a) && a; printf(\"%d card(s)\\n\",i-2))\n\t\tfor(i=2; a>0;)\n\t\t\ta -= 1. / i++;\n}",
"main(i)\n{\n\tfloat a;\n\tfor(;scanf(\"%f\",&a) && a; printf(\"%d card(s)\\n\",i-2))\n\t\tfor(i=2; a>0;)\n\t\t\ta -= 1. / i++;\n}",
"#include <stdio.h>\n\nint main()\n{\n while (1)\n {\n float l, sum=0.0;\n int n = 1;\n scanf(\"%f\", &l);\n\n if (l == 0.0)\n break;\n\n for (; sum <= l; )\n {\n // printf(\"%d\", sum);\n// if (n != 1)\n// n++;\n sum = sum + 1/((float)n+1);\n if (sum > l)\n break;\n n++;\n\n }\n printf(\"%d card(s)\\n\", n);\n }\n return 0;\n}\n",
"#include <stdio.h>\n\nint main()\n{\n while (1)\n {\n float d, sum=0.0;\n int n = 1;\n scanf(\"%f\", &d);\n\n if (d == 0.0)\n break;\n\n while (1)\n {\n sum = sum + 1/((float)n+1);\n\n if (sum > d)\n break;\n\n n++;\n }\n printf(\"%d card(s)\\n\", n);\n }\n return 0;\n}\n",
"#include <stdio.h>\n\nint main()\n{\n while (1)\n {\n float d, sum=0.0;\n int n = 1;\n scanf(\"%f\", &d);\n\n if (d == 0.0)\n break;\n\n while (1)\n {\n sum = sum + 1/((float)n+1);\n\n if (sum > d)\n break;\n\n n++;\n }\n printf(\"%d card(s)\\n\", n);\n }\n return 0;\n}\n",
"#include <stdio.h>\n\nint main() {\n\tfloat x, a;\n\tint j;\n\tdo {\n\t\tscanf(\"%f\", &x);\n\t\ta = 0.5;\n\t\tfor (float i = 1; i < 281; i++) {\n\t\t\tif (a >= x) {\n\t\t\t\tj = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ta += 1 / (i+2);\n\t\t}\n\t\t\n\t\tif(x != 0.00)\n\t\t\tprintf(\"%d card(s)\\n\", j);\n\t} while (x != 0.00);\n\n\treturn 0;\n}",
"#include<stdio.h>\nint main(){\n float sum,a;\n int k;\n while (scanf(\"%f\",&a)) {\n sum=0;\n k=2;\n if(a==0){\n return (0);\n }//end if\n else {\n while (sum<=a) {\n\n sum+=1.00/k;\n k++;\n }//end while\n }//end else\n printf(\"%d card(s)\\n\",k-2);\n }\n}\n"
],
"1_1319": [
"#include <stdio.h>\n#define myabs(x) (x) > 0 ? (x) : -(x)\n\nint main()\n{\n int ans,num,pos;\n scanf(\"%d%d\",&ans,&num);\n while(ans!=5280){\n pos=0;\n while(ans!=num){\n if((myabs(num-ans))==(myabs(ans-pos)))\n printf(\"Moving from %d to %d: same.\\n\",pos,num);\n else\n if((myabs(num-ans))>(myabs(pos-ans)))\n printf(\"Moving from %d to %d: colder.\\n\",pos,num);\n else\n printf(\"Moving from %d to %d: warmer.\\n\",pos,num);\n pos=num;\n scanf(\"%d\",&num);\n }\n printf(\"Moving from %d to %d: found it!\\n\",pos,num);\n scanf(\"%d%d\",&ans,&num);\n if(ans!=5280)\n printf(\"\\n\");\n }\n return 0;\n}\n",
"#include <stdio.h>\n\nint main() {\n\tint joey, cookie;\n\tint current_distance, next_distance;\n\tint c, first;\n\tfirst = 1;\n\twhile (1) {\n\t\tjoey = 0;\n\t\tscanf(\"%d\", &cookie);\n\t\tif (cookie >= 5280 || cookie <= -5280) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_distance = cookie - joey;\n\t\tif (current_distance < 0) {\n\t\t\tcurrent_distance = -current_distance;\n\t\t}\n\t\tif (first == 1) {\n\t\t\tfirst = 0;\n\t\t} else {\n\t\t\tputchar('\\n');\n\t\t}\n\t\twhile (scanf(\"%d\", &c)) {\n\t\t\tif (c > 5280 || cookie < -5280) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnext_distance = c - cookie;\n\t\t\tif (next_distance < 0) {\n\t\t\t\tnext_distance = -next_distance;\n\t\t\t}\n\t\t\tif (next_distance == 0) {\n\t\t\t\tprintf(\"Moving from %d to %d: found it!\\n\", joey, c);\n\t\t\t\tbreak;\n\t\t\t} else if (next_distance < current_distance) {\n\t\t\t\tprintf(\"Moving from %d to %d: warmer.\\n\", joey, c);\n\t\t\t} else if (next_distance > current_distance) {\n\t\t\t\tprintf(\"Moving from %d to %d: colder.\\n\", joey, c);\n\t\t\t} else {\n\t\t\t\tprintf(\"Moving from %d to %d: same.\\n\", joey, c);\n\t\t\t}\n\t\t\tcurrent_distance = next_distance;\n\t\t\tjoey = c;\n\t\t}\n\t}\n\treturn 0;\n}",
"int ran = 0;\n\nint main()\n{\n int target;\n\n for (;;)\n {\n scanf(\"%d\", &target);\n if (target == 5280) { break; }\n\n if (ran > 0) printf(\"\\n\");\n ran = 1;\n\n //printf(\"Target: %d\\n\", target);\n\n int prev_pos = 0, cur_pos;\n int prev_dst = abs(target), cur_dst;\n\n for (;;)\n {\n scanf(\"%d\", &cur_pos);\n cur_dst = abs(target - cur_pos);\n\n printf(\"Moving from %d to %d: \", prev_pos, cur_pos);\n\n if (cur_pos == target) { printf(\"found it!\\n\"); break; }\n\n if (cur_dst < prev_dst)\n {\n printf(\"warmer.\\n\");\n\n } else if (cur_dst > prev_dst) {\n printf(\"colder.\\n\");\n\n } else {\n printf(\"same.\\n\");\n }\n\n prev_dst = cur_dst;\n prev_pos = cur_pos;\n }\n }\n\n return 0;\n}\n",
"#define H printf(\n#define V scanf(\"%d\", &\nmain(f, k, c, p, a, b){ c=0;\n\twhile(~V f) && f-5280) {\t\t\n\t\tH c++?\"\\n\":\"\");\n\t\tp = 0;\n\t\twhile(V k)) {\n\t\t\tH \"Moving from %d to %d: \", p, k);\n\t\t\ta = p > f ? p - f: f - p, b = k > f ? k - f: f - k;\n\t\t\tif (!b && H \"found it!\\n\")) break;\t\n\t\t\tH a!=b?a<b?\"colder.\\n\":\"warmer.\\n\":\"same.\\n\");\n\t\t\tp = k;\n\t\t}\n\t}\n}",
"main(f, k, c, p, a, b)\n{\nc=0;\n\twhile(~scanf(\"%d\",&f) && f-5280) {\t\t\n\t\tprintf(c++?\"\\n\":\"\");\n\t\tp = 0;\n\t\twhile(~scanf(\"%d\", &k)) {\n\t\t\tprintf(\"Moving from %d to %d: \",p,k);\n\t\t\ta = p > f ? p - f: f - p;\n\t\t\tb = k > f ? k - f: f - k;\n\t\t\tif (!b && printf(\"found it!\\n\")) break;\n\t\t\t\n\t\t\tif (a==b) printf(\"same.\\n\");\n\t\t\tif (a>b) printf(\"warmer.\\n\");\n\t\t\tif (a<b) printf(\"colder.\\n\");\n\t\t\tp = k;\n\t\t}\n\t}\n}",
"main(f, k, c, p, a, b){ c=0;\n\twhile(~scanf(\"%d\",&f) && f-5280) {\t\t\n\t\tprintf(c++?\"\\n\":\"\");\n\t\tp = 0;\n\t\twhile(~scanf(\"%d\", &k)) {\n\t\t\tprintf(\"Moving from %d to %d: \",p,k);\n\t\t\ta = p > f ? p - f: f - p;\n\t\t\tb = k > f ? k - f: f - k;\n\t\t\tif (!b && printf(\"found it!\\n\")) break;\t\n\t\t\tprintf(a!=b?(a<b?(\"colder.\\n\"):\"warmer.\\n\"):\"same.\\n\");\n\t\t\t\n\t\t\tp = k;\n\t\t}\n\t}\n}",
"#define H printf(\n#define V scanf(\"%d\", &\nmain(f, k, c, p, a, b){ c=0;\n\twhile(~V f) && f-5280) {\t\t\n\t\tH c++?\"\\n\":\"\");\n\t\tp = 0;\n\t\twhile(V k)) {\n\t\t\tH \"Moving from %d to %d: \", p, k);\n\t\t\ta = p > f ? p - f: f - p, b = k > f ? k - f: f - k;\n\t\t\tif (!b && H \"found it!\\n\")) break;\t\n\t\t\tH a-b?a<b?\"colder.\\n\":\"warmer.\\n\":\"same.\\n\");\n\t\t\tp = k;\n\t\t}\n\t}\n}",
"#include <stdio.h>\n#include <stdlib.h>\nint ck;void f(){int n,c=0;scanf(\"%d\",&n);while(n!=ck){printf (\"Moving from %d to %d: \",c,n);int d1=abs(c-ck);int d2=abs(n-ck);if(d1>d2)printf(\"warmer.\\n\");else if(d1<d2)printf(\"colder.\\n\");else printf(\"same.\\n\");c=n;scanf(\"%d\",&n);}printf(\"Moving from %d to %d: found it!\\n\",c,n);}int main(){scanf(\"%d\",&ck);int st=1;while(ck!=5280){if(!st)printf(\"\\n\");if(st)st=0;f(ck);scanf(\"%d\",&ck);}return 0;}",
"#include <stdio.h>\n#include <stdlib.h>\n#define s scanf\n#define p printf\nint ck;main(){s(\"%d\",&ck);int st=1;while(ck!=5280){if(!st)p(\"\\n\");if(st)st=0;int n,c=0;s(\"%d\",&n);while(n!=ck){p(\"Moving from %d to %d: \",c,n);int d1=abs(c-ck);int d2=abs(n-ck);if(d1>d2)p(\"warmer.\\n\");else if(d1<d2)p(\"colder.\\n\");else p(\"same.\\n\");c=n;s(\"%d\",&n);}p(\"Moving from %d to %d: found it!\\n\",c,n);s(\"%d\",&ck);}}",
"#include <stdlib.h>\n#define s scanf\n#define p printf\nmain(){int d,b,n,c,ck,st=1;s(\"%d\",&ck);while(ck!=5280){c=0;if(!st)p(\"\\n\");if(st)st=0;s(\"%d\",&n);while(n!=ck){p(\"Moving from %d to %d: \",c,n);d=abs(c-ck);b=abs(n-ck);if(d>b)p(\"warmer.\\n\");else if(d<b)p(\"colder.\\n\");else p(\"same.\\n\");c=n;s(\"%d\",&n);}p(\"Moving from %d to %d: found it!\\n\",c,n);s(\"%d\",&ck);}}",
"#include <stdlib.h>\n#define s(X) scanf(\"%d\",&(X))\n#define p printf\nmain(){int d,b,n,c,ck,st=1;s(ck);while(ck!=5280){c=0;if(!st)p(\"\\n\");if(st)st=0;s(n);while(n!=ck){p(\"Moving from %d to %d: \",c,n);d=abs(c-ck);b=abs(n-ck);if(d>b)p(\"warmer.\\n\");else if(d<b)p(\"colder.\\n\");else p(\"same.\\n\");c=n;s(n);}p(\"Moving from %d to %d: found it!\\n\",c,n);s(ck);}}",
"#include<stdio.h>\n\nint abs(int x)\n{\n\tif(x<0)\n\t\treturn -x;\n\treturn x;\n}\n\nint main()\n{\n\tint cok_pos,f_pos,s_pos,flag=0;\n\tchar x;\n\twhile(1)\n\t{\n\t\tscanf(\"%d\",&cok_pos);\n\t\t\n\t\tif(cok_pos==5280)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif(flag)\n\t\t\tprintf(\"\\n\");\n\n\t\tf_pos=0;\n\t\t\n\t\twhile(1)\n\t\t{\n\t\t\tscanf(\"%d\",&s_pos);\n\n\t\t\t\n\t\t\tif(s_pos==cok_pos)\n\t\t\t{\n\t\t\t\tprintf(\"Moving from %d to %d: found it!\\n\",f_pos,s_pos);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif(abs(f_pos-cok_pos)>abs(s_pos-cok_pos))\n\t\t\t\tprintf(\"Moving from %d to %d: warmer.\\n\",f_pos,s_pos);\n\t\t\telse if(abs(f_pos-cok_pos)<abs(s_pos-cok_pos))\n\t\t\t\tprintf(\"Moving from %d to %d: colder.\\n\",f_pos,s_pos);\n\t\t\telse\n\t\t\t\tprintf(\"Moving from %d to %d: same.\\n\",f_pos,s_pos);\n\n\t\tf_pos=s_pos;\n\t\t\n\t\t}\n\t\tflag=1;\t\n\t}\n\t\n\treturn 0;\n\n}",
"int main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}",
"int main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}",
"int main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}",
"#include<stdio.h>\n\nint main(){\n\t\t\tint place,dif,lastdif,x,lastx;\n\n\tscanf(\"%d\",&place);\n\twhile(1){\n\t\tlastx=0;\n\t\tx=0;\n\t\t\n\t\tdif=1;\n\t\twhile(scanf(\"%d\",&x)){\n\t\tlastdif=(place>lastx ? place-lastx:lastx-place);\n\t\t\n\t\tdif=(place>x ? place-x:x-place);\n\t\tprintf(\"Moving from %d to %d: \",lastx,x);\n\t\tif(dif==0){\n\t\t\tprintf(\"found it!\\n\");\n\t\t\tbreak;\n\t\t}else if(dif==lastdif)\n\t\t\tprintf(\"same.\\n\");\n\t\telse if(dif<lastdif)\n\t\t\tprintf(\"warmer.\\n\");\n\t\telse\n\t\t\tprintf(\"colder.\\n\");\n\t\t\n\n\t\tlastx=x;\n\t\t}\n\t\tscanf(\"%d\",&place);\n\t\tif(place==5280)break;\n\t\tprintf(\"\\n\");\n\t}\n\treturn 0;\n}",
"#include<stdio.h>\n\nint main(){\nint place,dif,lastdif,x,lastx;\n\nscanf(\"%d\",&place);\nwhile(1){\nlastx=0;\nx=0;\n\ndif=1;\nwhile(scanf(\"%d\",&x)){\nlastdif=(place>lastx ? place-lastx:lastx-place);\n\ndif=(place>x ? place-x: x-place);\nprintf(\"Moving from %d to %d: \",lastx,x);\nif(dif==0){\nprintf(\"found it!\\n\");\nbreak;\n}else if(dif==lastdif)\nprintf(\"same.\\n\");\nelse if(dif<lastdif)\nprintf(\"warmer.\\n\");\nelse\nprintf(\"colder.\\n\");\n\n\nlastx=x;\n}\nscanf(\"%d\",&place);\nif(place==5280)break;\nprintf(\"\\n\");\n}\nreturn 0;\n}",
"#include <stdio.h>\n#include <math.h>\n\nint main()\n{\n\tint cookie, lastPosition = 0, position ,flag=0;\n\n\twhile(1)\n\t{\n\t\tscanf(\"%d\", &cookie);\n\t\tif(cookie >= 5280)\n\t\t\tbreak;\n\t\tif(flag)\n\t\t{\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\twhile(1)\n\t\t{\n\n\t\t\tscanf(\"%d\", &position);\n\t\t\tif(position == cookie)\n\t\t\t{\n\t\t\t\tprintf(\"Moving from %d to %d: found it!\\n\", lastPosition, position);\n\t\t\t\tlastPosition = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif( abs(lastPosition-cookie) < abs(position-cookie) )\n\t\t\t\tprintf(\"Moving from %d to %d: colder.\\n\", lastPosition, position);\n\t\t\telse if( abs(lastPosition-cookie) > abs(position-cookie) )\n\t\t\t\tprintf(\"Moving from %d to %d: warmer.\\n\", lastPosition, position);\n\t\t\telse if( abs(lastPosition-cookie) == abs(position-cookie) )\n\t\t\t\tprintf(\"Moving from %d to %d: same.\\n\", lastPosition, position);\n\n\t\t\tlastPosition=position;\n\t\t}\n\t\tflag=1;\n\t}\n\n\treturn 0;\n}\n",
"#include<stdio.h>\n#include<math.h>\nint main()\n{\n int a,b=0,c,goal,counter=0;\n \n while(1){\n scanf(\"%d\", &a);\n goal=a;\n \n if(a==5280)break;\n if (counter!=0)\n printf(\"\\n\");\n \n while(b!=goal){\n scanf(\"%d\" , &c);\n if (c!=goal){\n if(abs((b-goal))<abs((c-goal)))\n printf(\"Moving from %d to %d: colder.\\n\" ,b , c);\n else if (abs((b-goal))>abs((c-goal)))\n printf(\"Moving from %d to %d: warmer.\\n\" ,b , c);\n else if (abs((b-goal))==abs((c-goal)))\n printf(\"Moving from %d to %d: same.\\n\" ,b , c);\n }\n else printf(\"Moving from %d to %d: found it!\\n\" ,b , c);\n \n \n \n b=c;\n }\n b=0;\n counter++;\n }\n \n \n \n return 0;\n}",
"#include <stdio.h>\n#include <stdlib.h>\nint main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) {\n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}\n",
"#include <stdio.h>\nint main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}\n\n",
"int main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}",
"#include <stdio.h>\nint main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}",
"#include<stdio.h>\nint main() {\n int f, k, p, a, b, c=0;\n while(~scanf(\"%d\",&f) && f-5280) { \n printf(c++?\"\\n\":\"\");\n p = 0;\n while(~scanf(\"%d\", &k)) {\n printf(\"Moving from %d to %d: \",p,k);\n a = p > f ? p - f: f - p;\n b = k > f ? k - f: f - k;\n if (!b && printf(\"found it!\\n\")) break;\n\n if (a==b) printf(\"same.\\n\");\n if (a>b) printf(\"warmer.\\n\");\n if (a<b) printf(\"colder.\\n\");\n p = k;\n }\n }\n return 0;\n}"
],
"1_101073": [
"#include <stdio.h>\n\nint main()\n{\n\tint t;\n\tscanf(\"%d\",&t);\n\twhile(t--)\n\t{\n\t\tint n;\n\t\tscanf(\"%d\",&n);\n\t\tif(n==0)\n\t\t\tprintf(\"0\\n\");\n\t\telse\n\t\t{\n\t\t\tint min=1000;\n\t\t\tint max=-1000;\n\t\t\twhile(n--)\n\t\t\t{\n\t\t\t\tint a;\n\t\t\t\tscanf(\"%d\",&a);\n\t\t\t\tmin=a<min?a:min;\n\t\t\t\tmax=a>max?a:max;\n\t\t\t}\n\t\t\tprintf(\"%d\\n\",2*(max-min));\n\t\t}\n\t}\n\treturn 0;\n}",
"main () {\n\tint n,s,h,l;\n\tfor(scanf(\"%d\", &n);scanf(\"%d\", &n)>0;printf(\"%d\\n\",2*(h-l))) for (h=-1,l=100;n&&scanf(\"%d\", &s);n--) l = l<s?l:s, h = h<s?s:h;\n}\n\n",
"main() {\n\tint t, n, x, m, a;\n\tfor(scanf(\"%d\",&t); x=0,m=100,t--; printf(\"%d\\n\",2*(x-m)))\n\t\tfor (scanf(\"%d\",&n); n; n--) {\n\t\t\tscanf(\"%d\",&a);\n\t\t\tx=a<x?x:a;\n\t\t\tm=a<m?a:m;\n\t\t}\n}\n",
"main() {\n\tint t, n, x, m, a;\n\tfor(scanf(\"%d\",&t); x=0,m=100,t--; printf(\"%d\\n\",2*(x-m)))\n\t\tfor (scanf(\"%d\",&n); n--&&scanf(\"%d\",&a); )\n\t\t\tx=a<x?x:a, m=a<m?a:m;\n}",
"#define A \"%d\\n\"\nmain() {\n\tint t, n, x, m, a;\n\tfor(scanf(A,&t); x=0,m=A,t--; printf(A,2*(x-m)))\n\t\tfor (scanf(A,&n); n--&&scanf(A,&a); )\n\t\t\tx=a<x?x:a, m=a<m?a:m;\n}",
"#define A(X) scanf(\"%d\",&X)\nmain() {\n\tint t, n, x, m, a;\n\tfor(A(t); x=0,m=100,t--; printf(\"%d\\n\",2*(x-m)))\n\t\tfor (A(n); n--&&A(a); )\n\t\t\tx=a<x?x:a, m=a<m?a:m;\n}",
"#define A scanf(\"%d\"\nmain() {\n\tint t, n, x, m, a;\n\tfor(A,&t); x=0,m=100,t--; printf(\"%d\\n\",2*(x-m)))\n\t\tfor (A,&n); n--&&A,&a); )\n\t\t\tx=a<x?x:a, m=a<m?a:m;\n}",
"#define A scanf(\"%d\",&\nmain() {\n\tint t, n, x, m, a;\n\tfor(A t); x=0,m=100,t--; printf(\"%d\\n\",2*(x-m)))\n\t\tfor (A n); n--&&A a); )\n\t\t\tx=a<x?x:a, m=a<m?a:m;\n}",
"#define A scanf(\"%d\",&\nmain() {\n\tint t, n, x, m, a;\n\tfor(A t); x=0,m=\"\",t--; printf(\"%d\\n\",2*(x-m)))\n\t\tfor (A n); n--&&A a); )\n\t\t\tx=a<x?x:a, m=a<m?a:m;\n}",
"#define R scanf(\"%d\",&\nmain () {\n\tint n,s,h,l;\n\tfor(R n);R n)>0;printf(\"%d\\n\",2*(h-l))) for (l=\"\",h=0;n&&R s);n--) l = l<s?l:s, h = h<s?s:h;\n}",
"#define R scanf(\"%d\",&\nmain () {\n\tint n,s,h,l;\n\tfor(R n);R n)>0;printf(\"%d\\n\",2*(h-l))) for (l=\"\",h=0;n--&&R s);) l = l<s?l:s, h = h<s?s:h;\n}",
"#define A scanf(\"%d\",&\nmain() {\n\tint n, x, m, a;\n\tfor(A n); x=0,m=\"\",A n)>0; printf(\"%d\\n\",2*(x-m)))\n\t\tfor (; n--&&A a); )\n\t\t\tx=a<x?x:a, m=a<m?a:m;\n}",
"#define A scanf(\"%d\",&\nmain() {\n\tint n, x, m, a;\n\tfor(A n); A n)>0; printf(\"%d\\n\",2*(x-m)))\n\t\tfor (x=0,m=\"\"; n--&&A a); )\n\t\t\tx=a<x?x:a, m=a<m?a:m;\n}",
"#include <stdio.h>\n\nint main() {\n\tint shops, tests, min, max, tmp, sum, i;\n\n\tscanf(\"%d\", &tests);\n\n\twhile (tests--) {\n\t\tscanf(\"%d\", &shops);\n\t\tmax = 0;\n\t\tmin = 100;\n\t\tsum = 0;\n\t\tfor (i = 0; i < shops; i++) {\n\t\t\tscanf(\"%d\", &tmp);\n\t\t\tif (tmp > max) {\n\t\t\t\tmax = tmp;\n\t\t\t}\n\t\t\tif (tmp < min) {\n\t\t\t\tmin = tmp;\n\t\t\t}\n\t\t\tsum += tmp;\n\t\t}\n\t\tsum = (float) sum / shops + 0.5;\n\t\tprintf(\"%d\\n\", (max - sum) * 2 + (sum - min) * 2);\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n int t;\n scanf( \"%d\", &t );\n while ( t-- )\n {\n int n, max, min, i;\n scanf( \"%d\", &n );\n scanf( \"%d\", &max );\n min = max;\n for ( i = 1; i < n; ++i )\n {\n int num;\n scanf( \"%d\", &num );\n if ( num < min )\n min = num;\n if ( num > max )\n max = num;\n }\n printf( \"%d\\n\", 2 * ( max - min ) );\n }\n return EXIT_SUCCESS;\n}\n",
"#include <stdio.h>\n#include <limits.h>\n\nint main()\n{\n\tint tests, shops, parking, min, max;\n\n\tscanf(\"%d\",&tests);\n\n\twhile(tests--)\n\t{\n\t\tmin = INT_MAX;\n\t\tmax = INT_MIN;\n\n\t\tscanf(\"%d\", &shops);\n\t\tfor(int i=0; i<shops; i++)\n\t\t{\n\t\t\tscanf(\"%d\", &parking);\n\t\t\tif(parking < min)\n\t\t\t\tmin=parking;\n\t\t\tif(parking > max)\n\t\t\t\tmax=parking;\n\t\t}\n\t\tprintf(\"%d\\n\", (max-min) * 2);\n\t}\n\n\treturn 0;\n}\n",
"#include<stdio.h>\n#include<limits.h>\nint main()\n{\n int bar,i=0,t,j,x,max=INT_MIN,min=INT_MAX;\n scanf(\"%d\", & bar);\n for(i=0 ; i<bar ; i++){\n scanf(\"%d\" ,&t);\n for(j=0;j<t;j++){\n scanf(\"%d\" ,&x);\n if(x>max) max=x;\n if(x<min) min=x;\n }\n printf(\"%d\\n\" , 2*(max-min));\n max=INT_MIN;\n min=INT_MAX;\n }\n}",
"#include <stdio.h> \n \nint main() \n{ \n int n, t, max, min, i, pos; \n scanf(\"%d\", &t); \n while(t--) { \n scanf(\"%d\", &n); \n max = 0; \n min = 100; \n for(i = 0; i < n; i++) { \n scanf(\"%d\", &pos); \n if(pos < min) { \n min = pos; \n } \n if(pos > max) { \n max = pos; \n } \n } \n printf(\"%d\\n\", (max-min)*2); \n } \n return 0; \n}"
],
"1_2599": [
"#include <stdio.h>\nint main()\n{\n\tint n = 0;\n\twhile( scanf(\"%d\" , &n) > 0 && n != 0 )\n\t{\n\t\tint num[10] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 };\n\t\tint x = 1000000000;\n\t\tint n2 = n;\n\t\tint i = 0;\n\t\tint realNum = 0;\n\t\twhile( x!= 0 )\n\t\t{\n\t\t\tnum[i] = n2 / x;\n\t\t\tn2 = n2 % x;\n\t\t\tx = x / 10;\n\t\t\t++i;\n\t\t}\n\t\tfor( i = 0 ; i < 10 ; ++i )\n\t\t{\n\t\t\tif( num[i] > 4 ) num[i] = num[i] - 1;\n\t\t}\n\t\tx = 1;\n\t\tfor( i = 9 ; i >= 0 ; --i )\n\t\t{\n\t\t\trealNum += num[i] * x;\n\t\t\tx = x * 9;\n\t\t}\n\t\tprintf(\"%d: %d\\n\" , n , realNum );\n\t}\n}",
"main(n, a, m, i) {\n\twhile(scanf(\"%d\", &n), n){\n\t\ta=n, m=0;\n\t\tfor (i=1;n;i*=9) {\n\t\t\tm+=i*(n%10-(n%10>4));\n\t\t\tn/=10;\n\t\t}\n\t\tprintf(\"%d: %d\\n\", a, m);\n\t}\n}",
"main()\n{\n\tfor(int n,m,s,i;m=scanf(\"%d\",&n)*n;printf(\"%d: %d\\n\",n,--s))\n\t\t\tfor(s=i=1;m;s+=i*(m%10>4?m%10-1:m%10),m/=10,i*=9);\n}",
"main()\n{\n\tfor(int n,m,s,i;m=scanf(\"%d\",&n)*n;printf(\"%d: %d\\n\",n,--s))\n\t\t\tfor(i=s=1;s+=(m%10>4?m-1:m)%10*i,m/=10;i*=9);\n}\n",
"#include<stdio.h>\nint main()\n{\n int n,T,C,d,c;\n scanf(\"%d\",&n);\n while(n != 0){\n c=0;d=n;C=1;\n while(d>0){\n T = d%10;\n if(T>4) T--;\n c += T*C;\n C *= 9; \n d/=10; \n }\n printf(\"%d: %d\\n\",n,c); \n scanf(\"%d\",&n);\n }\n return 0;\n}\n",
"int n, i;\nchar s[10];\nmain() {\n\tfor (; scanf(\"%s\",&s),s[0]-'0'; printf(\"%s: %d\\n\", s, n))\n\t\tfor (n=i=0; s[i];n += (s[i]-(s[i++]>52)-48))\n\t\t\tn*=9;\n}\n",
"main(n,i,s,d) {\n\tfor (; i=scanf(\"%d\",&s),d=s,s; printf(\"%d: %d\\n\", d, n))\n\t\tfor (n=0; s;i*=9, s/=10)\n\t\t\tn+=(s%10-(s%10>4))*i;\n}"
],
"1_1659": [
"main(){\n\tdouble t,l;\n\tfor (scanf(\"%lf\",&l);scanf(\"%lf\",&t),t!=999;printf(\"%.2lf\\n\",t-l),l=t);\n\tprintf(\"End of Output\\n\");\n}",
"main() {\n\tfloat m, n;\n\tfor (scanf(\"%f\",&n);;printf(\"%.2f\\n\",n-m)) {\n\t\tm = n;\n\t\tscanf(\"%f\",&n);\n\t\tif (n==999)\n\t\t\tbreak;\n\t}\n\tprintf(\"End of Output\\n\");\n}",
"#include <stdio.h>\nint main()\n{\n\tfloat a,b,dif;\n\tscanf(\"%f\",&a);\n\twhile(scanf(\"%f\",&b) && b!=999)\n\t{\n\t\tdif=b-a;\n\t\tprintf(\"%.2f\\n\",dif);\n\t\ta=b;\n\t}\n\tprintf(\"End of Output\\n\");\n\treturn 0;\n}",
"main()\n{\n\tfloat x,s;\n\tfor(scanf(\"%f\",&s);scanf(\"%f\",&x),x-999;printf(\"%.2f\\n\",x-s),s=x);\n\tprintf(\"End of Output\\n\");\n}",
"main()\n{\n float a,b;\n for(scanf(\"%f%f\",&a,&b);b-999;a=b,scanf(\"%f\",&b))\n printf(\"%.2f\\n\",b-a);\n printf(\"End of Output\\n\");\n}",
"#include<stdio.h>\nint main()\n{\n\tfloat a,b;\n\tscanf(\"%f\",&a);\n\tif(a!=999)\n\t{\n\t\twhile(1)\n\t\t{\n\t\t\tscanf(\"%f\",&b);\n\t\t\tif(b==999)\n\t\t\t\tbreak;\n\t\t\tprintf(\"%.2f\\n\",b-a);\n\t\t\ta=b;\n\t\t}\n\t}\n\tprintf(\"End of Output\\n\");\n\treturn 0;\n}",
"#include<stdio.h>\nint main(){\n\tfloat a,b;\n\tscanf(\"%f\",&a);\n\twhile(scanf(\"%f\",&b)&&b!=999){\n\t\tprintf(\"%.2f\\n\",b-a);\n\t\ta=b;\n\n\t}\n\tprintf(\"End of Output\\n\");\n\treturn 0;\n}",
"#include<stdio.h>\nint main(){\n\tfloat a,b;\n\tscanf(\"%f\",&a);\n\twhile(scanf(\"%f\",&b)!=EOF&&b!=999){\n\t\tprintf(\"%.2f\\n\",b-a);\n\t\ta=b;\n\n\t}\n\tprintf(\"End of Output\\n\");\n\treturn 0;\n}",
"#include<stdio.h>\n\nint main(int argc, char* argv[])\n{\n float a,b;\n for(scanf(\"%f\",&a);;a=b)\n {\n scanf(\"%f\",&b);\n if(b==999)break;\n printf(\"%.2f\\n\",b-a);\n }\n printf(\"End of Output\\n\");\n return 0;\n}",
"#include<stdio.h>\n\nint main()\n{\n\tfloat a[200];\n\tint j =0 ,i;\n\n\twhile (1)\n\t{\n\t\tscanf(\"%f\" , &a[j]);\n\n\t\tif(a[j] == 999)\n\t\t\tbreak;\n\t\tj++;\n\n\t\t\n\t}\n\n\tfor(i=0 ; i<j-1 ; i++)\n\t{\n\t\tprintf(\"%.2f\\n\",a[i+1] - a[i]);\n\t}\n\tprintf(\"End of Output\\n\");\n\n}\n"
],
"1_1009": [
"main() {\n\tdouble f;\n\tint i,s;\n\tfor(i=s=0;i<12;i++) {\n\t\tscanf(\"%lf\",&f);\n\t\ts+=(int)(100*f);\n\t}\n\ts=(int)(s/12.+.5);\n\tprintf(\"$%d.%d\\n\",s/100,s%100);\n}",
"main() {\n\tdouble f;\n\tint i,s;\n\tfor(i=s=0;i++<12;s+=(int)(100*f))\n\t\tscanf(\"%lf\",&f);\n\ts=(s/12.+.5);\n\tprintf(\"$%d.%d\\n\",s/100,s%100);\n}",
"#include <stdio.h>\nint main()\n{\n\tfloat temp;\n\tstatic float all=0;\n\tfor(int i=0;i<12;i++)\n\t{\n\t\tscanf(\"%f\",&temp);\n\t\tall+=temp;\n\t}\n\tprintf(\"$%.2f\\n\",all/12);\n}",
"#include <stdio.h> \nint main(void)\n{\n\tfloat x = 0.0,y;\n\tint i=0;\n\tfor(;i<12;i++)\n\t\t{scanf(\"%f\",&y);x+=y;}\n\t\n\tprintf(\"$%.2f\\n\",x/12);\n}",
"#include <stdio.h>\nint main()\n{\n\tint i=12;\n\tfloat sum=0;\n\tfloat a;\n\twhile(i)\n\t{\n\t\tscanf(\"%f\",&a);\n\t\ti--;\n\t\tsum+=a;\n\t}\n\tprintf(\"$%.2f\\n\",sum/12);\n\treturn 0;\n}",
"main() {\n\tfloat s=0,t,i=12;\n\tfor(;i--;s+=t) scanf(\"%f\",&t);\n\tprintf(\"$%.2f\\n\",s/=12);\n}",
"main()\n{\n\tfloat a,s=0,i=12;\n\tfor (;i--;scanf(\"%f\",&a),s+=a);\n\t\t\n\t\n\n\tprintf(\"$%.2f\\n\",s/12);\n}",
" main()\n{\n\tfloat a,s=0,i=12;\n\tfor (;i--;scanf(\"%f\",&a),s+=a);\n\t\t\n\t\n\n\tprintf(\"$%.2f\\n\",s/12);\n}",
" main()\n{\n\tfloat a,s=0,i=12;\n\tfor (;i--;scanf(\"%f\",&a),s+=a);\n\t\t\n\t\n\n\tprintf(\"$%.2f\\n\",s/12);\n}",
"main()\n{\n\tfloat x,s=0,c=12;\n\tfor(;c--;scanf(\"%f\",&x),s+=x);\t\n\tprintf(\"$%.2f\\n\",s/12);\n}",
"main()\n{\n\tfloat x,s=0;\n\tfor(;scanf(\"%f\",&x)+1;s+=x);\t\n\tprintf(\"$%.2f\\n\",s/12);\n}\n",
"#include<stdio.h>\nint main(){\n\tfloat sum=0,in;\n\twhile(scanf(\"%f\",&in)!=EOF){\n\t\tsum+=in;\n\t}\n\tprintf(\"$%.2f\\n\",sum/12);\n\treturn 0;\n}",
"#include <stdio.h>\nint main()\n{\n\tdouble num, avg=0;\n\n\tfor(int i=0;i<12;i++)\n\t{\n\t\tscanf(\"%lf\", &num);\n\t\tavg+=num/12;\n\t}\n\n\tprintf(\"$%.2f\\n\", avg);\n}",
"#include<stdio.h>\n#include<math.h>\nint main()\n{\n double sum=0,y;\n int i=0;\n for (i=0 ; i<12 ; i++){\n scanf(\"%lf\" , &y);\n sum=sum+y;\n }\n printf(\"$%.2f\\n\" , sum/12);\n \n \n }",
"main()\n{\n\tdouble n,s=0;\n\tfor(int i=0;i<12;i++)\n\t{\n\t\tscanf(\"%lf\",&n);\n\t\ts+=n;\n\t}\n\tprintf(\"$%.2lf\\n\",s/12);\n}",
"main(i)\n{\n i=12;\n double n,s=0;\n while(scanf(\"%lf\",&n),i)\n {\n s+=n;\n i--;\n }\n printf(\"$%.2lf\\n\",s/12);\n}",
"main(i)\n{\n i=12;\n double n,s=0;\n while(scanf(\"%lf\",&n),i--)\n s+=n;\n printf(\"$%.2lf\\n\",s/12);\n}",
"main(i)\n{\n i=12;\n float n,s=0;\n while(scanf(\"%f\",&n),i--)\n {\n s+=n;\n }\n printf(\"$%.2f\\n\",s/12);\n}",
"main(i)\n{\n i=12;\n float n,s=0;\n while(scanf(\"%f\",&n),i--)\n s+=n;\n printf(\"$%.2f\\n\",s/12);\n}",
"#include<stdio.h>\n#include<stdlib.h>\n\nint main()\n{\n\tfloat Num [12],R=0;\n\tint i ;\n\tfor(i=0 ; i<12 ; i++)\n\t\tscanf(\"%f\",&Num[i] );\n\tfor(i=0 ; i<12 ; i++)\n\t\tR += Num[i];\n\tprintf(\"$%.2f\\n\",R/12);\n}",
" #include <stdio.h>\n int main() {\n float x,sum=0;\n int i=0;\n // freopen(\"input.txt\",\"r\",stdin);\n while(scanf(\"%f\",&x) != EOF){\n sum+=x;\n i++;\n if(i==12){\n printf(\"$%.2f\\n\",sum/12);\n i=0;\n sum=0;\n}\n}\n return 0;\n }",
"#include <stdio.h>\nint main(){\n int i;\n double sum=0,num;\n for(i=0;i<12;i++){\n scanf(\"%lf\",&num);\n sum+=num;\n }\n printf(\"$%.2lf\\n\",sum/12);\n return 0;\n}\n",
"float s,a;\nmain (i)\n{\n\tfor (; i++<13 ; s+=a)\n\t\tscanf(\"%f\",&a);\n\tprintf ( \"$%.2f\\n\" , s/12);\t\n}",
"#include <stdio.h>\nint main(){\n\tfloat a=0,b=0;\n\tfor(int i=0;i<12;i++){\n\t\tscanf(\"%f\", &a);\n\t\tb=b+a;\n\t}\n\tprintf(\"$\");\n\tprintf(\"%0.2f\\n\", b/12);\n\n\treturn 0;\n}",
"#include<stdio.h>\n\nint main() {\n\tint i = 0;\n\tfloat sum=0,aver=0,n;\n\tfor (i = 1; i <= 12; i++) {\n\t\tscanf(\"%f\",&n);\n\t\t//if (n <= 0) { return 0; }\n\t\tsum += n;\n\t}\n\taver = sum / 12.00;\n\tprintf(\"$%.2f\\n\",aver);\n\n}",
"#include<stdio.h>\nint main(){\n float a,s=0;\n int i;\n\n for(i=1;i<=12;i++){\n scanf(\"%f\",&a);\n s+=a;\n }\n s/=12;\n printf(\"$%.2f\\n\",s);\n }\n\n",
"float s,a;\nint main ()\n{\n\tfor (; ~scanf(\"%f\",&a) ;s+=a);\n\tprintf ( \"$%.2f\\n\" , s/12);\t\n}",
"float s,a;\nmain ()\n{\n\tfor (; ~scanf(\"%f\",&a) ;s+=a);\n\tprintf ( \"$%.2f\\n\" , s/12);\t\n}"
],
"1_106025": [
"char s[1005];\nmain(){\n\tint i,c,C;\n\tfor(scanf(\"%d\",&i);scanf(\"%s\",&s)>0;printf(\"\\n\"))\n\t\tfor(i=0;c=1,C=s[i],s[i];){\n\t\t\tfor(i++;s[i]==C;i++,c++);\n\t\t\tprintf(\"%d%c\",c,C);\n\t\t}\n}",
"main(n,i,j) {\n\tchar c[1005];\n\tfor (scanf(\"%d\", &n); ~scanf(\"%s\", c);printf(\"\\n\"))\n\t\tfor (i=0; c[i];printf(\"%d%c\", i-j,c[j]))\n\t\t\tfor (j = i; c[j]==c[i];i++);\n}\n",
"main(n,i,j) {\n\tchar c[1005];\n\tfor (scanf(\"%d\", &n); ~scanf(\"%s\", c);printf(\"\\n\"))\n\t\tfor (i=0; c[j=i];printf(\"%d%c\", i-j,c[j]))\n\t\t\tfor(;c[j]==c[i];)i++;\n}\n",
"main(n,i,j) {\n\tchar c[1001];\n\tfor (scanf(\"%d\", &n); ~scanf(\"%s\", c);printf(\"\\n\"))\n\t\tfor (i=0; c[j=i];printf(\"%d%c\", i-j,c[j]))\n\t\t\tfor(;c[j]==c[i];i++);\n}\n",
"char s[1005];\nmain(i, c, C){\n\tfor(scanf(\"%d\",&i);scanf(\"%s\",&s)>0;printf(\"\\n\"))\n\t\tfor(i=0;c=1,C=s[i],s[i];printf(\"%d%c\",c,C))\n\t\t\tfor(i++;s[i]==C;i++,c++);\n\t\t\t\n\t\t\n}",
"char s[1005];\nmain(i, c, C){\n\tfor(scanf(\"%d\",&i);scanf(\"%s\",&s)>0;printf(\"\\n\"))\n\t\tfor(i=0;c=1,C=s[i];printf(\"%d%c\",c,C))\n\t\t\tfor(i++;s[i]==C;i++,c++);\n}",
"char s[1005];\nmain(i, c, C){\n\tfor(scanf(\"%d\",&i);~scanf(\"%s\",&s);printf(\"\\n\"))\n\t\tfor(i=0;c=1,C=s[i];printf(\"%d%c\",c,C))\n\t\t\tfor(i++;s[i]==C;i++,c++);\n}",
"main() {\n\tchar c[1005];\n\tint n, i, j;\n\tfor (scanf(\"%d\\n\", &n); n; n--) {\n\t\tscanf(\"%s\", c);\n\t\tfor (i = 0; c[i];printf(\"%d%c\", i-j,c[j]))\n\t\t\tfor (j = i; c[i]==c[j]; i++);\n\t\tprintf(\"\\n\");\n\t}\n}\n",
"main() {\n\tchar c[1005];\n\tint n, i, j;\n\tfor (scanf(\"%d\", &n); n--;) {\n\t\tscanf(\"%s\", c);\n\t\tfor (i = 0; c[i];printf(\"%d%c\", i-j,c[j]))\n\t\t\tfor (j = i; c[j]==c[i];i++);\n\t\tprintf(\"\\n\");\n\t}\n}\n",
"main() {\n\tchar c[1005];\n\tint n, i, j;\n\tfor (scanf(\"%d\", &n); n--;printf(\"\\n\"))\n\t\tfor (i=!scanf(\"%s\", c); c[i];printf(\"%d%c\", i-j,c[j]))\n\t\t\tfor (j = i; c[j]==c[i];i++);\n}",
"#include <stdio.h>\n\nint main()\n{\n int t, i, cnt;\n char s[1005];\n scanf(\"%d\", &t);\n while( t-- )\n {\n scanf(\"%s\", s);\n cnt = 1;\n for( i=1; s[i]; i++ )\n {\n if ( s[i] == s[i-1] )\n cnt++;\n else\n {\n printf(\"%d%c\", cnt, s[i-1]);\n cnt = 1;\n }\n }\n printf(\"%d%c\\n\", cnt, s[i-1]);\n }\n return 0;\n}\n",
"#include <stdio.h>\n\nint main()\n{\n\tint tests;\n\tchar buff[1001];\n\tint last=0, count;\n\n\tscanf(\"%d\", &tests);\n\n\twhile(tests--)\n\t{\n\t\tscanf(\"%s\",buff);\n\t\tlast=buff[0];\n\t\tcount=1;\n\t\tfor(int i=1;buff[i];i++)\n\t\t{\n\t\t\tif(last==buff[i])\n\t\t\t\tcount++;\n\t\t\telse\n\t\t\t{\n\t\t\t\tprintf(\"%d%d\", count, last-'0');\n\t\t\t\tcount=1;\n\t\t\t\tlast=buff[i];\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d%d\\n\", count, last-'0');\n\t}\n\treturn 0;\n}"
],
"1_106017": [
"#define c(n) ((n)*(n)*(n))\nmain() {\n\tfor(int n;scanf(\"%d\",&n)>0;) printf((n==c(n%10)+c(n/10%10)+c(n/100))?\"Yes\\n\":\"No\\n\");\n}",
"#define c(n) ((n)*(n)*(n))\nmain(n) {\n\tfor(;~scanf(\"%d\",&n);) printf((n==c(n%10)+c(n/10%10)+c(n/100))?\"Yes\\n\":\"No\\n\");\n}",
"#include <stdio.h>\nint main()\n{\n\tint n;\n\twhile( scanf(\"%d\", &n) != EOF )\n\t{\n\t\tint c = 0, m = n;\n\t\tfor( ; n; n/=10 ) { int d = n%10; c += d*d*d; }\n\t\tputs( c == m ? \"Yes\" : \"No\" );\n\t}\n\treturn 0;\n}\n\n",
"main()\n{\t\n\tfor(int x;scanf(\"%d\",&x)+1;x-153&&x-370&&x-371&&x-407? printf(\"No\\n\"): printf(\"Yes\\n\"));\t\n}",
"#include <stdio.h>\n\n\nint main()\n{\n\tint num, digit, sum, temp;\n\twhile(scanf(\"%d\", &num) != EOF)\n\t{\n\t\tsum = 0;\n\t\ttemp = num;\n\t\twhile(num > 0)\n\t\t{\n\t\t\tdigit = num%10;\n\t\t\tnum /= 10;\n\t\t\tsum += (digit*digit*digit);\n\t\t}\n\t\tif(sum == temp)\n\t\t{\n\t\t\tprintf(\"Yes\\n\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"No\\n\");\n\t\t}\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n#include <stdlib.h>\n\nint power(int b, int e)\n{\n\tint r=b;\n\n\tfor(int i=1;i<e;i++)\n\t\tr*=b;\n\n\treturn r;\n}\nint main()\n{\n\tint dig[3], num, tmp;\n\twhile(1)\n\t{\n\t\tscanf(\"%d\",&num);\n\t\tif(feof(stdin))\n\t\t\tbreak;\n\t\ttmp=num;\n\t\tdig[0] = tmp % 10;\n\t\ttmp/=10;\n\t\tdig[1] = tmp % 10;\n\t\ttmp/=10;\n\t\tdig[2] = tmp % 10;\n\t\t\n\t\tif(power(dig[0],3)+power(dig[1],3)+power(dig[2],3) == num)\n\t\t\tprintf(\"Yes\\n\");\n\t\telse\n\t\t\tprintf(\"No\\n\");\n\t}\n\treturn 0;\n}",
"main(n) {\n\tfor (;~scanf(\"%d\",&n);\n\t\t\tprintf(n-153&&n/2-185&&n-407?\"No\\n\":\"Yes\\n\"));\n}",
"main(n) {\n\tfor (;~scanf(\"%d\",&n);\n\t\t\tputs(n-153&&n/2-185&&n-407?\"No\":\"Yes\"));\n}",
"main(n){for(;~scanf(\"%d\",&n);puts(n-153&&n/2-185&&n-407?\"No\":\"Yes\"));}"
],
"1_2358": [
"#define p(x) (x)*(x)\nmain () {\n\tfor(double a,b,c,d;scanf(\"%lf%lf%lf%lf\",&a,&b,&c,&d)>0;printf((p(a-c-d)+p(b-c-d) >= p(c+d)) ? \"Yes\\n\" : \"No\\n\"));\n}",
"main()\n{\n\tfor(float a,b,c,d;scanf(\"%f%f%f%f\",&a,&b,&c,&d)+1;b>2*c&&b>2*d?printf(\"Yes\\n\"):printf(\"No\\n\"));\n}",
"#include <math.h>\nmain()\n{\n\tfloat a, b, r1, r2;\n\twhile (scanf(\"%f%f%f%f\",&a,&b,&r1,&r2)+1)\n\t{\n\t\tif (pow(a - r1 - r2, 2) + pow(b - r1 - r2, 2) >= pow(r1 + r2, 2))\n\t\t\tprintf(\"Yes\\n\");\n\t\telse\n\t\t\tprintf(\"No\\n\");\n\t}\n}",
"#include <math.h>\nmain(){\n\tfloat a,b,r,j;\n\twhile(scanf(\"%f%f%f%f\", &a,&b,&r, &j) +1)if (pow(b-r-j,2) + pow(a-r-j,2) >= pow(r+j,2)) printf(\"Yes\\n\"); else printf(\"No\\n\");\n\t\n}",
"\nmain(){\n\tfloat a,b,r,j;\n\twhile(scanf(\"%f%f%f%f\", &a,&b,&r, &j) +1)if ((b-r-j) * (b-r-j) + (a-r-j) * (a-r-j) >= (r+j) * (r+j)) printf(\"Yes\\n\"); else printf(\"No\\n\");\n\t\n}",
"#include <math.h>\nmain()\n{\n\tfloat a, b, r, t;\n\twhile (scanf(\"%f%f%f%f\", &a, &b, &r, &t) + 1)if (((a - r - t)*(a - r - t) + (b - r - t)*(b - r - t)) >= (t + r)*(r + t))printf(\"Yes\\n\"); else printf(\"No\\n\");\n}",
"#include <math.h>\nmain()\n{\n\tfloat a, b, r, t;\n\twhile (scanf(\"%f%f%f%f\", &a, &b, &r, &t) + 1)if (((a - r - t)*(a - r - t) + (b - r - t)*(b - r - t)) >= (t*t+r*r+2*r*t))printf(\"Yes\\n\"); else printf(\"No\\n\");\n}",
"\nmain(){\n\tfloat a,b,r,j;\n\t\n\twhile(scanf(\"%f%f%f%f\", &a,&b,&r, &j) +1){ float c = b-r-j,d=a-r-j,h=r+j;if (c*c + d * d >= h*h) printf(\"Yes\\n\"); else printf(\"No\\n\");}\n\t\n}",
"main()\n{\n\tfloat a, b, r, t;\n\twhile (scanf(\"%f%f%f%f\", &a, &b, &r, &t) + 1)if (((a - r - t)*(a - r - t) + (b - r - t)*(b - r - t)) >= (t*t+r*r+2*r*t))printf(\"Yes\\n\"); else printf(\"No\\n\");\n}",
"main()\n{\n\tfloat a, b, r, t;\n\twhile (scanf(\"%f%f%f%f\", &a, &b, &r, &t) + 1)if ((a - r - t)*(a - r - t) + (b - r - t)*(b - r - t) >= (r+t)*(r+t))printf(\"Yes\\n\"); else printf(\"No\\n\");\n}",
"main()\n{\n\tfloat a, b, r, t;\n\twhile (~scanf(\"%f%f%f%f\", &a, &b, &r, &t))if ((a - r - t)*(a - r - t) + (b - r - t)*(b - r - t) >= (r+t)*(r+t))printf(\"Yes\\n\"); else printf(\"No\\n\");\n}",
"main()\n{\n\tfloat a, b, r, t;\n\twhile (~scanf(\"%f%f%f%f\", &a, &b, &r, &t))if ((a - r - t)*(a - r - t) + (b - r - t)*(b - r - t) >= (r+t)*(r+t))printf(\"Yes\\n\"); else printf(\"No\\n\");\n}",
"main() {\n\tfor (float a, b, c, d, e, f; scanf(\"%f%f%f%f\", &a, &b, &c, &d)+1;) {\n\t\te = a-d-c;\n\t\tf = b-d-c;\n\t\tprintf(sqrt(e*e+f*f) < c + d + 0.01 ? \"No\\n\" : \"Yes\\n\");\n\t}\n}",
"main() {\n\tfor (float a, b, c, d; scanf(\"%f%f%f%f\", &a, &b, &c, &d)+1;) {\n\t\ta -= c+=d;\n\t\tb -= c;\n\t\tprintf(sqrt(a*a+b*b) < c+.01 ? \"No\\n\" : \"Yes\\n\");\n\t}\n}",
"main() {\n\tfor (float a, b, c, d; ~scanf(\"%f%f%f%f\", &a, &b, &c, &d);printf(sqrt(a*a+(b-=c)*b) < c+.01 ? \"No\\n\" : \"Yes\\n\"))\n\t\ta -= c+=d;\n}",
"main() {\n\tfor (float a, b, c, d; ~scanf(\"%f%f%f%f\", &a, &b, &c, &d);printf(sqrt(a*a+(b-=c)*b) < c ? \"No\\n\" : \"Yes\\n\"))\n\t\ta -= c+=d;\n}",
"main() {\n\tfor (float a, b, c, d; ~scanf(\"%f%f%f%f\", &a, &b, &c, &d);printf(a*a+(b-=c)*b < c*c ? \"No\\n\" : \"Yes\\n\"))\n\t\ta -= c+=d;\n}",
"main() {\n\tfor (float a, b, c, d; ~scanf(\"%f%f%f%f\", &a, &b, &c, &d);printf(a*a+(b-=c)*b < 2*a*c ? \"No\\n\" : \"Yes\\n\"))\n\t\tc+=d;\n}",
"main() {\n\tfor (float a, b, c, d; ~scanf(\"%f%f%f%f\", &a, &b, &c, &d);printf(a*a+(b-=c+=d)*b < 2*a*c ? \"No\\n\" : \"Yes\\n\"))\n\t\t;\n}",
"main() {\n\tfor (float a, b, c, d; ~scanf(\"%f%f%f%f\", &a, &b, &c, &d);printf((b-=c+=d)*b < a*(2*c-a) ? \"No\\n\" : \"Yes\\n\"))\n\t\t;\n}",
"main() {\n for (float a, b, c, d; ~scanf(\"%f%f%f%f\", &a, &b, &c, &d);b-=c+=d,printf(a*a+b*b < 2*a*c ? \"No\\n\" : \"Yes\\n\")) ;\n}",
"main() {\n\tfor (float a, b, c, d; ~scanf(\"%f%f%f%f\", &a, &b, &c, &d);puts(a*a+(b-=c+=d)*b < 2*a*c ? \"No\" : \"Yes\"))\n\t\t;\n}"
],
"1_1018": [
"main(){\n\tint n,A,B,a[35],b[35],f=0,i;\n\tfor (A=B=0;scanf(\"%d\",&n), n;printf(\"A has %d points. B has %d points.\\n\",A,B), A=B=0){\n\t\tif(f) printf(\"\\n\");\n\t\tf=1;\n\t\tfor(i=0;i<n;i++) scanf(\"%d\", a+i);\n\t\tfor(i=0;i<n;i++) scanf(\"%d\", b+i);\n\t\tfor(i=0;i<n;i++) {\n\t\t\tif(a[i]>b[i]+1) A+=a[i];\n\t\t\tif(b[i]>a[i]+1) B+=b[i];\n\t\t\tif(a[i]==b[i]+1)B+=(b[i]==1)?6:(a[i]+b[i]);\n\t\t\tif(b[i]==a[i]+1)A+=(a[i]==1)?6:(a[i]+b[i]);\n\t\t}\n\t}\n\n\treturn 0;\n}\n",
"#include<stdio.h>\n\nint main()\n{\n\tint N[200], i,j=0,z=0 , a[200][22] ={0} , b[200][22]={0} , Bpoint[200]={0} , Apoint[200]={0} ,temp;\n\tscanf(\"%d\",&N[0]);\n\twhile(N[j])\n\t{\n\t\tfor(i=0; i<N[j] ; i++)\n\t\t\t\tscanf(\"%d\", &a[j][i]);\n\t\tfor(i=0; i<N[j] ; i++)\n\t\t\t\tscanf(\"%d\", &b[j][i] );\n\t\tj++;\n\t\tscanf(\"%d\",&N[j]);\n\t}\n\n\tfor (z = 0; z <j ; z++)\n\t{\n\n\t\tfor(i=0 ; i<N[z] ; i++)\n\t\t{\n\t\t\tif( a[z][i] == b[z][i] );\t\n\t\t\telse if( b[z][i] == 2 && a[z][i] == 1 )\n\t\t\t\tApoint[z] += 6;\n\n\t\t\telse if( b[z][i] == 1 && a[z][i] == 2 )\n\t\t\t\tBpoint[z] += 6;\n\n\t\t\telse if( a[z][i] - b[z][i] > 1 )\n\t\t\t\tApoint[z] += a[z][i];\n\n\t\t\telse if( b[z][i] - a[z][i] > 1 )\n\t\t\t\tBpoint[z] += b[z][i];\n\n\t\t\telse if( b[z][i] - a[z][i] == 1 )\n\t\t\t\tApoint[z] += ( a[z][i] + b[z][i] ) ;\n\n\t\t\telse if( b[z][i] - a[z][i] == -1 )\n\t\t\t\tBpoint[z] += ( a[z][i] + b[z][i] ) ;\t\n\t\t\t}\n\t\tprintf(\"A has %d points. B has %d points.\\n\" ,Apoint[z],Bpoint[z]);\n\t\tif (j-z!=1)\n\t\t\tprintf(\"\\n\");\n\t}\n}",
"#include<stdio.h>\n\nint main()\n{\n int N[200], i,j=0,z=0 , a[200][22] ={0} , b[200][22]={0} ,\nBpoint[200]={0} , Apoint[200]={0} ,temp;\n scanf(\"%d\",&N[0]);\n while(N[j])\n {\n for(i=0; i<N[j] ; i++)\n scanf(\"%d\", &a[j][i]);\n for(i=0; i<N[j] ; i++)\n scanf(\"%d\", &b[j][i] );\n j++;\n scanf(\"%d\",&N[j]);\n }\n\n for (z = 0; z <j ; z++)\n {\n\n for(i=0 ; i<N[z] ; i++)\n {\n if( a[z][i] == b[z][i] );\n else if( b[z][i] == 2 && a[z][i] == 1 )\n Apoint[z] += 6;\n\n else if( b[z][i] == 1 && a[z][i] == 2 )\n Bpoint[z] += 6;\n\n else if( a[z][i] - b[z][i] > 1 )\n Apoint[z] += a[z][i];\n\n else if( b[z][i] - a[z][i] > 1 )\n Bpoint[z] += b[z][i];\n\n else if( b[z][i] - a[z][i] == 1 )\n Apoint[z] += ( a[z][i] + b[z][i] ) ;\n\n else if( b[z][i] - a[z][i] == -1 )\n Bpoint[z] += ( a[z][i] + b[z][i] ) ;\n }\n printf(\"A has %d points. B has %d points.\\n\" ,Apoint[z],Bpoint[z]);\n if (j-z!=1)\n printf(\"\\n\");\n }\n}\n"
],
"1_1230": [
"char s[100000];\nint main() {\n\tint i,n,l;\n\tfor(;scanf(\"%s\",s) && !(s[0] == '0' && s[1] == 0);){\n\t\t for(l=0;s[l];l++);\n\t\t for (i=n=0;i<l;i++) n+=s[i]-'0';\n\t\t printf(\"%d\\n\",n%9?n%9:9);\n\t}\n}\n",
"#include <stdio.h>\n#include <string.h>\n\nint main(void)\n{\n char x[1000] ;\n int i;\n while(scanf(\"%s\",(char*)x) != EOF)\n {\n if(x[0]=='0')\n break;\n int sum = 0 ;\n for(i = 0; i < strlen(x) ;i++) \n sum+= (x[i] - '0');\n \n sum%=9;\n if(sum==0)\n printf(\"9\\n\");\n else \n printf(\"%d\\n\",sum);\n memset(x, 0, sizeof(x));\n }\n}",
"a;\nmain(c)\n{\n\tfor(;scanf(\"%c\",&c),c>10?a+=c-48,1:a;c<11?printf(\"%d\\n\",a%9?a%9:9),a=0:0);\n}",
"#include<stdio.h>\n\nmain(){\n\tchar s[1000];\n\twhile(scanf(\"%s\", s) && s[0] != '0'){\n\t\tint r = 0, i = 0;\n\t\twhile(s[i] != 0)\n\t\t\tr += s[i++]-'0';\n\t\tprintf(\"%d\\n\", r%9?r%9:9);\n\t}\n}",
"main(i, s){\n\tfor(s=8;\n\t\tscanf(\"%c\",&i), i-10 ? s+=i-'0' : s-8;\n\t\ti<11 ? printf(\"%d\\n\",s%9+1), s=8:1\n\t);\n}",
"main(i, s){\n\tfor(s=8;\n\t\tscanf(\"%c\",&i), i-10 ? s+=i-48 : s-8;\n\t\ti<11 ? printf(\"%d\\n\",s%9+1), s=8:1\n\t);\n}",
"main(i, s){\n\tfor(s=8;\n\t\ti=getchar(), i-10 ? s+=i-48 : s-8;\n\t\ti<11 ? printf(\"%d\\n\",s%9+1), s=8:1\n\t);\n}",
"main(c,n)\n{\n\tfor(;n;)\n\t{\n\t\tfor(c=n=0;scanf(\"%c\", &c),c-10;n = n/10 + n%10)\n\t\t\tn += c - 48;\n\t\tif (n)\n\t\t\tprintf(\"%d\\n\", n);\n\t}\n}",
"a;\nmain(c)\n{\n\tfor(;scanf(\"%c\",&c),c+a-10;a=c<11?printf(\"%d\\n\",a%9?a%9:9),0:a+c-48);\n}",
"a;\nmain(c)\n{\n\tfor(;scanf(\"%c\",&c),c+a-64;a=c<11?printf(\"%d\\n\",a%9?a%9:9),0:a+c+6);\n}",
"a;\nmain(c)\n{\n\tfor(;c=getchar(),c+a-64;a=c<11?printf(\"%d\\n\",a%9?a%9:9),0:a+c+6);\n}",
"main(i, s){\n\tfor(s=8;\n\t\ti=getchar(), s+i-18;\n\t\ts=i-10?s+i-48:printf(\"%d\\n\",s%9+1)+6\n\t);\n}\n",
"main(c,n)\n{\n\tfor(;n;n?printf(\"%d\\n\", (n-1)%9+1):0)\n\t\tfor(c=n=0;scanf(\"%c\", &c),c-10;n += c - 48);\n}\n\n",
"main(c,n)\n{\n\tfor(;n;n?printf(\"%d\\n\", (n-1)%9+1):0)\n\t\tfor(n=0;scanf(\"%c\", &c),c-10;n += c - 48);\n}\n\n",
"a;\nmain(c)\n{\n\tfor(;c=getchar()+a-48;a=c-a+38?c:printf(\"%d\\n\",a%9?a%9:9)*0);\n}",
"a;\nmain(c)\n{\n\tfor(;c=getchar()+a-10;a=c-a?c-38:printf(\"%d\\n\",a%9?a%9:9)*0);\n}",
"n=0;\nmain(c)\n{\n for (;(c=getchar()-10) ? n+=c-38 : printf(\"%d\\n\", --n%9+1)+(n=0););\n}",
"a;\nmain(c)\n{\n for(;c=getchar()+a-10;a=c-a?c-38:printf(\"%d\\n\",--a%9+1)*0);\n}",
"c;\nmain(a)\n{ \n\tfor(;c+=a=getchar()-10;c=a?c-38:printf(\"%d\\n\",--c%9+1)*0);\n}",
"#include <stdio.h>\n\nint a;\nint c;\nint main()\n{ \n\tfor(;scanf(\"%c\",&c),c+a-64;a=c<11?printf(\"%d\\n\",a%9?a%9:9),0:a+c+6); \n}",
"#include <stdio.h>\n\nint main()\n{\n\tchar s[10000];\n\tint i;\n\n\twhile( gets(s) )\n\t{\n\t\tif ( s[0] == '0' ) break;\n\t\tint sum = 0;\n\t\tfor( i=0; s[i]; i++ )\n\t\t\tsum += s[i]-'0';\n\t\twhile( sum > 9 )\n\t\t{\n\t\t\tint x = sum;\n\t\t\tfor( sum=0; x; x/=10 )\n\t\t\t\tsum += x % 10;\n\t\t}\n\t\tprintf(\"%d\\n\", sum);\n\t}\n\treturn 0;\n}\n\n",
"main(i, s){\n for(s=8;\n i=getchar(), s+i-18;\n s=i-10?s+i-48:printf(\"%d\\n\",s%9+1)+6\n );\n}",
"a;\nmain(c)\n{ \n for(;c=getchar()+a-10;a=c-a?c-38:printf(\"%d\\n\",a%9?a%9:9)*0); \n\n}",
"#include <stdio.h>\n\nint a;\nint c;\nint main()\n{ \n\tfor(;scanf(\"%c\",&c),c+a-64;a=c<11?printf(\"%d\\n\",a%9?a%9:9),0:a+c+6); \n}"
],
"1_2371": [
"main() {\n\tfor(int n;scanf(\"%d\",&n)>0;printf(\"%d\\n\",n*(n+2)*(2*n+1)/8));\n}",
"main(n) {\n\tfor(;~scanf(\"%d\",&n);printf(\"%d\\n\",n*(n+2)*(2*n+1)/8));\n}",
"#include<stdio.h>\n\nvoid main()\n{\n\n\tint n ;\n\twhile(scanf(\"%d\\n\",&n) != EOF)\t\n\t{\n\t\tprintf(\"%d\\n\",(n * (n + 2) * (2*n + 1) / 8) );\n\t}\n\n}\n",
"main(n)\n{\n\twhile (~scanf(\"%d\", &n))\n\t\tprintf(\"%d\\n\", n*(n + 2)*(2 * n + 1) / 8);\n}"
],
"1_2578": [
"#include <stdio.h>\n#include <ctype.h>\nint n, i, c, d=30;\nchar *s;\nmain() {\n\ts = (char*)malloc(d);\n\tfor (scanf (\"%d\", &n),getline(&s,&d,stdin); n; n--) {\n\t\tgetline(&s, &d, stdin);\n\t\tfor (i = 0, c = 0; s[i]; i++)\n\t\t\tc+=(tolower(s[i])=='g'?1:(tolower(s[i])=='b'?-1:0));\n\t\ts[--i]=0;\n\t\tprintf(\"%s is %s\\n\", s, c>0?\"GOOD\":c<0?\"A BADDY\":\"NEUTRAL\");\n\t}\n}\n",
"char s[99];\nmain(n, i, c) {\n\tfor (scanf(\"%d\\n\", &n);scanf(\"%[^\\n]\\n\",s),n--;) {\n\t\tfor (c=i=0;s[i];i++) c+=tolower(s[i])-'g'?tolower(s[i])-'b'?0:-1:1;\n\t\tprintf(\"%s is %s\\n\", s, c>0?\"GOOD\":c<0?\"A BADDY\":\"NEUTRAL\");\n\t}\n}\n",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint tests,g=0,b=0;\n\tchar name[1024],teststr[1000];\n\n\tgets(teststr);\n\ttests=atoi(teststr);\n\twhile(tests--)\n\t{\n\t\tgets(name);\n\n\t\tfor(int i=0;name[i]!=0;i++)\n\t\t{\n\t\t\tif(name[i]=='g' || name[i]=='G')\n\t\t\t\tg++;\n\t\t\tif(name[i]=='b' || name[i]=='B')\n\t\t\t\tb++;\n\t\t}\n\t\t\n\t\tprintf(\"%s is \", name);\n\t\tif(g>b)\n\t\t\tprintf(\"GOOD\\n\");\n\t\telse if(b>g)\n\t\t\tprintf(\"A BADDY\\n\");\n\t\telse\n\t\t\tprintf(\"NEUTRAL\\n\");\n\n\t\tb=g=0;\n\t}\n\n\treturn 0;\n}"
],
"1_2610": [
"#include <stdio.h>\n#include <string.h>\n\nlong long d[1<<20], a;\nint c, n, D, t, s;\n\nint main()\n{\n\tscanf(\"%d\", &c);\n\twhile(c--)\n\t{\n\t\tscanf(\"%d%d\", &D, &n);\n\t\tmemset(d, 0, D*8);\n\t\ts = a = 0;\n\t\td[0] = 1;\n\t\twhile(n--)\n\t\t{\n\t\t\tscanf(\"%d\", &t);\n\t\t\ts = (s+t)%D;\n\t\t\td[s]++;\n\t\t}\n\t\twhile(D--)\n\t\t\ta += d[D]*(d[D]-1)/2;\n\t\tprintf(\"%d\\n\" ,a);\n\t}\n}",
"#include <stdio.h>\n#include <string.h>\n\nlong long d[1<<20], a;\nint c, n, D, t, s;\n\nmain()\n{\n\tscanf(\"%d\", &c);\n\twhile(c--)\n\t{\n\t\tscanf(\"%d %d\", &D, &n);\n\t\tmemset(d, 0, D*8);\n\t\ts = a = 0;\n\t\td[0] = 1;\n\t\twhile(n--)\n\t\t{\n\t\t\tscanf(\"%d\", &t);\n\t\t\td[s=(s+t)%D]++;\n\t\t}\n\t\twhile(D--)\n\t\t\ta += d[D]*(d[D]-1)/2;\n\t\tprintf(\"%lld\\n\" ,a);\n\t}\n}",
"#include <stdio.h>\n#include <string.h>\n\n#define w(x) while(x--)\n#define s(x) scanf(\"%d\",&x)\nlong long d[1<<20], a;\nint c, n, D, t, s;\n\nmain()\n{\n\ts(c);\n\tw(c)\n\t{\n\t\ts(D);s(n);\n\t\tmemset(d, 0, D*8);\n\t\ts = a = 0;\n\t\td[0] = 1;\n\t\tw(n)\n\t\t{\n\t\t\ts(t);\n\t\t\td[s=(s+t)%D]++;\n\t\t}\n\t\tw(D)\n\t\t\ta += d[D]*(d[D]-1)/2;\n\t\tprintf(\"%lld\\n\" ,a);\n\t}\n}"
],
"1_106022": [
"main() {\n\tint t, n, c, r, i;\n\tfor (scanf(\"%d %d\", &t, &n); t--; scanf(\"%d\", &n)) {\n\t\tfor (c=0; n > 10; c++) {\n\t\t\tr = n % 10;\n\t\t\tn /= 10;\n\t\t\tn += r>=5;\n\t\t}\n\t\tprintf(\"%d\", n);\n\t\tfor (i = 0; i < c; i++)\n\t\t\tprintf(\"0\");\n\t\tprintf(\"\\n\");\n\t}\n}\n",
"main(n,i){\n\tfor (scanf(\"%d\",&n);~scanf(\"%d\",&n);printf(\"%d\\n\",n))\n\t\tfor(i=1;i<1<<25;i*=10) n = n<i?n:(n+i/2)/i*i;\n}",
"#include <stdio.h>\n\nint main()\n{\n\tint p, t;\n\tscanf(\"%d\", &t);\n\twhile( t-- )\n\t{\n\t\tint x;\n\t\tscanf(\"%d\", &x);\n\t\tfor( p=10; x>p; p*=10 )\n\t\t\tif ( (x % p) >= (p / 2) ) x = ((x / p)+1)*p;\n\t\t\telse x = (x / p) * p;\n\t\tprintf(\"%d\\n\", x);\n\t}\n\treturn 0;\n}\n\n",
"#include <stdio.h>\n\nint main() {\n\tint num, div=1, i;\n\tint tests;\n\t\n\tscanf(\"%d\",&tests);\n\twhile(tests--)\n\t{\n\t\tscanf(\"%d\", &num);\n\n\t\tdiv=1;\n\t\tfor(i=0;num/div;i++)\n\t\t\tdiv*=10;\n\t\ti--;\n\t\tdiv/=100;\n\n\t\tif(div)\n\t\t{\n\t\t\tfor(int j=0;j<i;j++)\n\t\t\t{\n\t\t\t\tif(num%10<5)\n\t\t\t\t{\n\t\t\t\t\tnum = (num/10)*10;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnum = ((num/10)+1)*10;\n\t\t\t\t}\n\t\t\t\tnum/=10;\n\t\t\t}\n\t\t\tnum*=div*10;\n\t\t}\n\n\t\tprintf(\"%d\\n\",num);\n\t\t\n\t}\n\treturn 0;\n}\n"
],
"1_1959": [
"a,d,b,n;\nmain(f)\n{\nfor(;scanf(\"%d\",(f=n--)?&d:&n),(!f?a=b=n:--*(n&1^d?&a:&b))+1;n||printf(\"%d\\n\",a<b?a:b));\n}",
"a,d,b,n;\nmain(f)\n{\nfor(;scanf(\"%d\",(f=n--)?&d:&n),f&&--*(n&1^d?&a:&b)||(a=b=n)+1;n||printf(\"%d\\n\",a<b?a:b));\n}",
"a,d,b,n;\nmain(f)\n{\nfor(;scanf(\"%d\",(f=n--)?&d:&n),f||(a=b=n)>0;n||printf(\"%d\\n\",a<b?a:b))\nf&&--*(n&1^d?&a:&b);\n}",
"a,d,b,n;\nmain(f)\n{\nfor(;scanf(\"%d\",(f=n--)?&d:&n),f||(a=b=n)>0;n||printf(\"%d\\n\",a<b?a:b))\nf&&(*(n&1^d?&a:&b))--;\n}",
"a,d,b,n;\nmain(f)\n{\nfor(;scanf(\"%d\",(f=n--)?&d:&n),f||(a=b=n)>0;n||printf(\"%d\\n\",a<b?a:b))\nf&&(f=(n^d)&1,a-=f,b-=!f);\n}",
"a,d,b,n;\nmain(f)\n{\nfor(;scanf(\"%d\",(f=n--)?&d:&n),f||(a=b=n)>0;n||printf(\"%d\\n\",a<b?a:b))\nf&&(a-=(n^d)&1,b-=(n^d)&1^1);\n}",
"main() {\n\tint n, i, d, c;\n\tfor (;1+scanf(\"%d\", &n); printf(\"%d\\n\", c>n/2?n-c:c))\n\t\tfor (i = c = 0; i < n; c += (d==i++%2))\n\t\t\tscanf(\"%d\", &d);\n}\n",
"main(n, i, d, c) {\n\tfor (;1+scanf(\"%d\", &n); printf(\"%d\\n\", c>n/2?n-c:c))\n\t\tfor (i = c = 0; i < n; c += (d==i++%2))\n\t\t\tscanf(\"%d\", &d);\n}\n",
"main(n,i,d,c){\n\tfor(;~scanf(\"%d\",&n);printf(\"%d\\n\",c>n/2?n-c:c))\n\t\tfor(i=c=0;i<n;c+=(d==i++%2))\n\t\t\tscanf(\"%d\",&d);\n}",
"main(n,i,d,c){\n\tfor(;~scanf(\"%d\",&n);printf(\"%d\\n\",c>n/2?n-c:c))\n\t\tfor(i=c=0;i<n;c+=d^i++&1)\n\t\t\tscanf(\"%d\",&d);\n}",
"main(n,i,d,c){\n\tfor(;~scanf(\"%d\",&n);printf(\"%d\\n\",c>n/2?n-c:c))\n\t\tfor(i=c=0;i<n;c+=(d^i++%2))\n\t\t\tscanf(\"%d\",&d);\n}\n",
"a,d,b,n;\nmain(f)\n{\nfor(;scanf(\"%d\",(f=n)?&d:&n),!f?a=b=n:--*(--n&1^d?&a:&b)+1;n||printf(\"%d\\n\",a<b?a:b));\n}",
"a,b,n,d;\nmain(f)\n{\nfor(;scanf(\"%d\",f?&n:&d),f?a=b=n:--*(--n&1^d?&a:&b)+1;f=!n&&printf(\"%d\\n\",a<b?a:b));\n}",
"a,b,n,d;\nmain(f)\n{\nfor(;scanf(\"%d\",f?&n:&d),f?a=b=n:(a-=--n&1^d)+1;f=!n&&printf(\"%d\\n\",a<b-a?a:b-a));\n}",
"a,b,n,d;\nmain(f)\n{\nfor(;scanf(\"%d\",f?&n:&d),f?a=b=n:--n&1^d?a--:b--;f=!n&&printf(\"%d\\n\",a<b?a:b));\n}",
"a,b,n,d;\nmain(f)\n{\n\tfor(;scanf(\"%d\",f?&n:&d),a=f?b=n:a-(n--&1^d),b;f=n?0:printf(\"%d\\n\",a<b-a?a:b-a));\n}",
"#include<stdio.h>\nint main(){\nint n,i,tmp,c1,c2;\nwhile(scanf(\"%d\",&n)!=EOF){\n\tc1=0;\n\tc2=0;\n for(i=0;i<n;i++){\n\t scanf(\"%d\",&tmp);\n\t if(i%2==0){\n\t\t if(tmp)c1++;\n\t\t else c2++;\n\t }else{\n\t\t if(tmp)c2++;\n\t\t else c1++;\n\t }\n\t \n }\n if(c1>c2)c1=c2;\n\t printf(\"%d\\n\",c1);\n}\n\n\nreturn 0;}\n",
"#include<stdio.h>\nint main(){\nint n,i,tmp,c1,c2;\nwhile(scanf(\"%d\",&n)!=EOF){\n\tc1=0;\n\tc2=0;\n for(i=0;i<n;i++){\n\t scanf(\"%d\",&tmp);\n\t if(i%2==0){\n\t\t if(tmp)c1++;\n\t\t else c2++;\n\t }else{\n\t\t if(tmp)c2++;\n\t\t else c1++;\n\t }\n\t \n }\n if(c1>c2)c1=c2;\n\t printf(\"%d\\n\",c1);\n}\n\n\nreturn 0;}\n",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint n, correct=0,correct2=1, curr, wrong=0, wrong2=0;\n\n\twhile(1)\n\t{\n\t\tscanf(\"%d\",&n);\n\n\t\tif(feof(stdin))\n\t\t\tbreak;\n\n\t\tfor(int i=0; i<n; i++)\n\t\t{\n\t\t\tscanf(\"%d\", &curr);\n\t\t\tif(curr!=correct)\n\t\t\t\twrong++;\n\n\t\t\tif(curr!=correct2)\n\t\t\t\twrong2++;\n\n\t\t\tcorrect = (correct == 0) ? 1 : 0;\n\t\t\tcorrect2 = (correct2 == 0) ? 1 : 0;\n\t\t}\n\n\t\tif(wrong<wrong2)\n\t\t\tprintf(\"%d\\n\", wrong);\n\t\telse\n\t\t\tprintf(\"%d\\n\", wrong2);\n\n\t\twrong=wrong2=0;\n\t\tcorrect=0;\n\t\tcorrect2=1;\n\t}\n\treturn 0;\n}",
"main()\n{\n for(int i,n,k,c,x;scanf(\"%d\",&n)+1;printf(\"%d\\n\",c>x?x:c))\n {\n c=x=0;\n for(i=0;i<n;k==(i++%2) ? c++ : x++)\n scanf(\"%d\",&k);\n }\n}",
"main()\n{\n for(int i,n,k,c,x;scanf(\"%d\",&n)+1;printf(\"%d\\n\",c>x?x:c))\n {\n c=x=0;\n for(i=0;i<n;k==(i++%2) ? c++ : x++)\n scanf(\"%d\",&k);\n }\n}",
"a,b,n,d;\nmain(f)\n{\n\tfor(;scanf(\"%d\",f?&n:&d),a+=f?b=n,-a:n--+d&1,b;)\n\t\tf=n?0:printf(\"%d\\n\",a<b-a?a:b-a);\n}",
"a,f,d;\nmain(n)\n{\n\tfor(;scanf(\"%d\",f?&d:&n)+(a+=f?f+d&1:-a);)\n\t\tf=f<n?f+1:!printf(\"%d\\n\",a<n-a?a:n-a);\n}"
],
"1_106018": [
"q[1000001], n,i,j,f;\nmain() {\n\tfor (i = 2; i <= 1e6; i++)\n\t\tif (!q[i])\n\t\t\tfor (j = 2; i * j <= 1e6; j++)\n\t\t\t\tq[i*j] = 1;\n\twhile (scanf(\"%d\",&n),n) {\n\t\tfor (i = 2; i*i <= n && !f; i++)\n\t\t\tf=!q[i] && !(n%i) && !q[n/i];\n\t\tprintf(f?\"Yes\\n\":\"No\\n\");\n\t\tf=n=0;\n\t}\n}\n",
"n,c;\nmain(i) {\n\twhile (scanf(\"%d\",&n),n) {\n\t\tfor (c=i=1;i*i<=n;i++)\n\t\t\tc+=!(n%i);\n\t\tn=!printf(c^3?\"No\\n\":\"Yes\\n\");\n\t}\n}\n",
"n,c;\nmain(i) {\n\tfor (;scanf(\"%d\",&n),n;n=!printf(c^3?\"No\\n\":\"Yes\\n\"))\n\t\tfor (c=i=1;i*i<=n;i++)\n\t\t\tc+=!(n%i);\n}\n",
"#include <stdio.h>\n#define N 1000001\n\nchar ip[N/2];\nint p[100000], pn;\nvoid sieve()\n{\n\tint i, j;\n\tfor( i=3; i*i<=N; i+=2 )\n\t\tif ( !ip[i/2] )\n\t\t\tfor( j=i*i; j<N; j+=2*i )\n\t\t\t\tip[j/2] = 1;\n\tp[0] = 2;\n\tpn = 1;\n\tfor( i=3; i<N; i+=2 )\n\t\tif ( !ip[i/2] ) p[pn++] = i;\n}\n\nint check(int n)\n{\n\tint pc = 0, i;\n\tfor( i=0; i<pn && p[i]*p[i]<=n; i++ )\n\t{\n\t\tif ( n % p[i] == 0 )\n\t\t{\n\t\t\tif ( pc == 1 ) return 0;\n\t\t\tpc = 1;\n\t\t\tn /= p[i];\n\t\t\tif ( n == p[i] ) return 1;\n\t\t\tif ( n % p[i] == 0 ) return 0;\n\t\t}\n\t}\n\treturn pc;\n}\n\nint main()\n{\n\tint n;\n\tsieve();\n\twhile( scanf(\"%d\", &n) != EOF )\n\t\tputs( check(n) ? \"Yes\" : \"No\" );\n\treturn 0;\n}\n\n"
],
"1_106023": [
"d;\nint p(int A, int N) {\n\treturn A==1||N==1?A:p(A,N/2)*p(A,N/2)*(N%2?A:1);\n}\nmain(B,N,A) {\n\tfor(;scanf(\"%d%d\", &B, &N), B;printf(\"%d\\n\",p(A,N)-B<B-p(A-1,N)?A:A-1))\n\t\tfor (A=1;p(A,N)<B;A++);\n}\n",
"#include <stdio.h>\n#include <math.h>\n\nint power(int x, int n){ return n==0 ? 1 : x * power(x, n-1); }\nint main()\n{\n\tint b, n;\n\twhile( scanf(\"%d %d\", &b, &n), b || n )\n\t{\n\t\tdouble A = exp(log(b)/n);\n\t\tint A1 = (int)floor(A);\n\t\tint A2 = (int)ceil(A);\n\t\tprintf(\"%d\\n\",(b - power(A1, n) < power(A2, n) - b) ? A1 : A2);\n\t}\n\treturn 0;\n}\n\n",
"#include <stdio.h>\nint b,n;\nint pow(int a1, int b1){\n int m=1;\n int i;\n for(i=1;i<=b1;i++){\n m*=a1;\n }\n return m;\n}\nint main(){\n while(1){\n scanf(\"%d %d\",&b,&n);\n if(b==0 && n==0) return 0;\n int i;\n for(i=1;i<=1000000;i++){\n int t=pow(i,n);\n int t2=pow(i-1,n);\n if(t>=b){\n if(b-t2<t-b) printf(\"%d\\n\",i-1);\n else printf(\"%d\\n\",i);\n break;\n }\n }\n }\n return 0;\n}"
],
"1_106020": [
"i;\nmain(t) {\n\tlong long n;\n\tfor (scanf(\"%d\",&t);i<t;printf(\"%d %lld %lld\\n\",++i,n,((n+6)*n*n*n+11*n*n+6*n)/8))\n\t\tscanf(\"%lld\",&n);\n}\n",
"#include <stdio.h>\n\nint main()\n{\n\tint w[305];\n\tint t = 3, i;\n\n\tw[1] = 3;\n\tfor( i=2; i<=300; i++ )\n\t{\n\t\tt += i+1;\n\t\tw[i] = w[i-1] + i*t;\n\t}\n\tint N, n, c = 1;\n\tscanf(\"%d\", &N);\n\twhile( N-- )\n\t{\n\t\tscanf(\"%d\", &n);\n\t\tprintf(\"%d %d %d\\n\", c++, n, w[n]);\n\t}\n\treturn 0;\n}\n\n",
"#include <stdio.h>\n\nint T(int n)\n{\n\tint sum = 0;\n\tfor(int i=1;i<=n;i++)\n\t\tsum += i;\n\treturn sum;\n}\nint main()\n{\n\tint n,sum=0, dataset ,c=1;\n\n\tscanf(\"%d\", &dataset);\n\n\twhile(dataset--)\n\t{\n\t\tscanf(\"%d\", &n);\n\t\tfor(int i=1;i<=n;i++)\n\t\t\tsum += i*T(i+1);\n\n\t\tprintf(\"%d %d %d\\n\",c++, n, sum);\n\t\tsum=0;\n\t}\n\treturn 0;\n}"
],
"1_101329": [
"#include <stdio.h>\n\nint isprime(int x)\n{\n\tunsigned i;\n\tfor ( i = 3; ; i += 2 )\n\t{\n\t\tunsigned r = x % i;\n\t\tunsigned q = x / i;\n\t\tif ( q < i )\n\t\t\treturn 1;\n\t\telse if ( r == 0 )\n\t\t\treturn 0;\n\t}\n}\n\nint main()\n{\n\tint ntest;\n\tscanf(\"%d\", &ntest);\n\twhile ( ntest-- )\n\t{\n\t\tunsigned n;\n\t\tscanf(\"%u\", &n);\n\t\tif ( n <= 2 )\n\t\t{\n\t\t\tputs(\"2\");\n\t\t\tcontinue;\n\t\t}\n\t\tif ( !(n & 1) )\n\t\t\t++n;\n\t\twhile ( !isprime(n) )\n\t\t\tn += 2;\n\t\tprintf(\"%u\\n\", n);\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n#include <string.h>\n\nint mark[1000010];\nlong long prime[1000010], k;\n\nvoid ssieve()\n{\n\tint i, j;\n\tfor( i = 2 ; i * i < 1000000 ; i ++ )\n\t\tif( !mark[i] )\n\t\t\tfor( j = i * i ; j < 1000000 ; j += i )\n\t\t\t\tmark[j] = 1;\n\tprime[ k++ ] = 2;\n\tfor( i = 3 ; i < 1000000 ; i += 2 )\n\t\tif( !mark[i] )\n\t\t\tprime[ k++ ] = i;\n}\nint is( long long a )\n{\n\tif( a < 2 )\n\t\treturn 0;\n\tif( a == 2 )\n\t\treturn 1;\n\tlong long i;\n\tfor( i = 0 ; i < k && prime[i] * prime[i] <= a ; i ++ )\n\t\tif( a % prime[i] == 0 )\n\t\t\treturn 0;\n\treturn 1;\n}\n\nint main()\n{\n\tssieve();\n\tlong long n;\n\tint t;\n\tscanf( \"%d\" , &t );\n\twhile( t -- ) \n\t{\n\t\tscanf( \"%lld\" , &n );\n\t\tdo\n\t\t{\n\t\t\tif( is(n) )\n\t\t\t{\n\t\t\t\tprintf( \"%lld\\n\" , n );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}while( ++ n );\n\t}\n\treturn 0;\n}\n",
"unsigned int n, k;\nmain () {\n\tfor (scanf(\"%u\",&n);~scanf(\"%u\", &n);) {\n\t\tfor(n=n<2?2:n;;n++){\n\t\t\tfor (k=2;k*k<=n;k++) if (!(n%k)) goto N;\n\t\t\tprintf(\"%u\\n\",n);break;N:;\n\t\t}\n\t\t\n\t}\n}\n"
],
"1_2621": [
"#include <stdio.h>\n\nint main()\n{\n\tint ntest;\n\tscanf(\"%d\", &ntest);\n\twhile ( ntest-- )\n\t{\n\t\tint i, j;\n\t\tchar name[1024];\n\t\tscanf(\" %s\", name);\n\t\tfor ( j = 0; name[j]; ++j )\n\t\t{\n\t\t\tint x = name[j]-1 & 31;\n\t\t\tif ( x < 15 )\n\t\t\t\tx /= 3;\n\t\t\telse if ( x < 19 )\n\t\t\t\tx = 5;\n\t\t\telse if ( x < 22 )\n\t\t\t\tx = 6;\n\t\t\telse\n\t\t\t\tx = 7;\n\t\t\tname[j] = '2' + x;\n\t\t}\n\t\tfor ( i = 0; i < --j; ++i )\n\t\t\tif ( name[i] != name[j] )\n\t\t\t\tbreak;\n\t\tif ( i < j )\n\t\t\tputs(\"NO\");\n\t\telse\n\t\t\tputs(\"YES\");\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n#include <string.h>\n\nint main()\n{\n\tint tests, len=0, check;\n\tchar name[60];\n\n\tscanf(\"%d\", &tests);\n\twhile(tests--)\n\t{\n\t\tcheck=0;\n\t\tlen=0;\n\t\tscanf(\"%s\",name);\n\n\t\tfor(int i=0; name[i]!=0; i++)\n\t\t{\n\t\t\tlen++;\n\n\t\t\tif(name[i]<'a')\n\t\t\t\tname[i]+=32;\n\n\t\t\tswitch(name[i])\n\t\t\t{\n\t\t\tcase 'a':\n\t\t\tcase 'b':\n\t\t\tcase 'c':\n\t\t\t\tname[i]=2;\n\t\t\tbreak;\n\t\t\tcase 'd':\n\t\t\tcase 'e':\n\t\t\tcase 'f':\n\t\t\t\tname[i]=3;\n\t\t\tbreak;\n\t\t\tcase 'g':\n\t\t\tcase 'h':\n\t\t\tcase 'i':\n\t\t\t\tname[i]=4;\n\t\t\tbreak;\n\t\t\tcase 'j':\n\t\t\tcase 'k':\n\t\t\tcase 'l':\n\t\t\t\tname[i]=5;\n\t\t\tbreak;\n\t\t\tcase 'm':\n\t\t\tcase 'n':\n\t\t\tcase 'o':\n\t\t\t\tname[i]=6;\n\t\t\tbreak;\n\t\t\tcase 'p':\n\t\t\tcase 'q':\n\t\t\tcase 'r':\n\t\t\tcase 's':\n\t\t\t\tname[i]=7;\n\t\t\tbreak;\n\t\t\tcase 't':\n\t\t\tcase 'u':\n\t\t\tcase 'v':\n\t\t\t\tname[i]=8;\n\t\t\tbreak;\n\t\t\tcase 'w':\n\t\t\tcase 'x':\n\t\t\tcase 'y':\n\t\t\tcase 'z':\n\t\t\t\tname[i]=9;\n\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tfor(int i=0; i<len/2; i++)\n\t\t\tif(name[i]==name[len-i-1])\n\t\t\t\tcheck++;\n\t\t\t\n\t\tif(check==len/2)\n\t\t\tprintf(\"YES\\n\");\n\t\telse\n\t\t\tprintf(\"NO\\n\");\n\n\t}\n\treturn 0;\n}",
"#include<stdio.h>\n#include<string.h>\n#include <ctype.h>\nint main()\n{\nint n,i,x,z;\nchar a[22];\nint b[22];\nscanf(\"%d\",&n);\nwhile(n--)\n{\nscanf(\"%s\",a);\nfor(i=0;i<strlen(a);i++)\n{\nswitch(toupper(a[i]))\n{\ncase'A':case'B':case'C':x=2;break;\ncase'D':case'E':case'F':x=3;break;\ncase'G':case'H':case'I':x=4;break;\ncase'J':case'L':case'K':x=5;break;\ncase'M':case'N':case'O':x=6;break;\ncase'P':case'Q':case'R':case'S':x=7;break;\ncase'T':case'U':case'V':x=8;break;\ncase'W':case'X':case'Y':case'Z':x=9;break;\n}\nb[i]=x;\n}\nfor(z=1,i=0;i<strlen(a)/2;i++)\n{\nif(b[i]!=b[strlen(a)-1-i]) {z=0;break;}\n}\nif(z) printf(\"YES\\n\");\nelse printf(\"NO\\n\");\n}\n}"
],
"1_2695": [
"\n/* Howard Cheng */\n\n#include <stdio.h>\n\nint main(void)\n{\n int N, T1, T2, T3;\n int ticks; /* number of ticks if the mark is initially at T1 */\n \n\n while (scanf(\"%d %d %d %d\", &N, &T1, &T2, &T3) == 4 &&\n\t (N || T1 || T2 || T3)) {\n ticks = 2*N; /* first turn */\n ticks += N + ((T2 > T1) ? T2 - T1 : T2 + N - T1); /* second turn */\n ticks += (T2 > T3) ? T2 - T3 : T2 + N - T3;\n printf(\"%.3f\\n\", ticks + (N-1)/2.0);\n }\n\n\n return 0;\n}\n",
"#include <stdio.h>\n\nint f( int a, int b, int c, int n )\n{\n\tint r = 0;\n\twhile( a != b )\n\t\ta = ( a + c + n ) % n, r ++;\n\treturn r;\n}\n\nint main()\n{\n\tint n, t1, t2, t3, i;\n\tn=t1=t2=t3=i=0;\n\twhile( scanf( \"%d%d%d%d\" , &n, &t1, &t2, &t3 ) == 4 , n | t1 | t2 | t3 )\n\t{\n\t\tint tot = 0;\n\t\tfor( i = 0 ; i < n ; i ++ )\n\t\t\ttot += n+n+n+f( i , t1 , -1 , n ) + f( t1 , t2 , 1 , n ) + f( t2 , t3 , -1 , n );\n\t\tprintf( \"%.3lf\\n\" , tot/(n*1.) );\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n\nint f( int a, int b, int c, int n )\n{\n\tint r = 0;\n\twhile( a != b )\n\t\ta = ( a + c + n ) % n, r ++;\n\treturn r;\n}\n\nint main()\n{\n\tint n, t1, t2, t3, i;\n\tn=t1=t2=t3=i=0;\n\twhile( scanf( \"%d%d%d%d\" , &n, &t1, &t2, &t3 ) == 4 , n | t1 | t2 | t3 )\n\t{\n\t\tint tot = 0;\n\t\tfor( i = 0 ; i < n ; i ++ )\n\t\t\ttot += f( i , t1 , -1 , n ) + f( t1 , t2 , 1 , n ) + f( t2 , t3 , -1 , n );\n\t\tprintf( \"%.3lf\\n\" , n+n+n+tot/(n*1.) );\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n\nint main(void)\n{\n int N, T1, T2, T3;\n int ticks; \n\n while (scanf(\"%d %d %d %d\", &N, &T1, &T2, &T3) == 4 &&\n\t (N || T1 || T2 || T3)) {\n ticks = 2*N;\n ticks += N + ((T2 > T1) ? T2 - T1 : T2 + N - T1);\n ticks += (T2 > T3) ? T2 - T3 : T2 + N - T3;\n printf(\"%.3f\\n\", ticks + (N-1)/2.0);\n }\n\n return 0;\n}\n"
],
"1_2677": [
"#include <stdio.h>\n\nint n;\nint a[1048576];\n\nint mysort(int *first, int *last)\n{\n\tint *i, *j, mid;\n\tstatic int buf[1048576];\n\tif ( first >= last )\n\t\treturn 0;\n\tfor ( mid = 0[i = first], j = buf; ++i < last; )\n\t\tif ( *i < mid )\n\t\t\t*j++ = *i;\n\tfor ( i = first; ++i < last; )\n\t\tif ( *i >= mid )\n\t\t\t*j++ = *i;\n\t*j = mid;\n\tfor ( i = first, j = buf; i < last; )\n\t\t*i++ = *j++;\n\tfor ( i = first; *i < mid; ++i ) ;\n\tmysort(first, i);\n\tmysort(i, last-1);\n\treturn mid;\n}\n\nint main()\n{\n\tint i;\n\tn = 0;\n\twhile ( scanf(\"%d\", a+n) == 1 )\n\t\t++n;\n\tmysort(a, a+n);\n\tfor ( i = 0; i < n; ++i )\n\t\tprintf(\"%d\\n\", a[i]);\n\treturn 0;\n}\n",
"#include <stdio.h>\n#include <stdlib.h>\n\ntypedef struct T\n{\n\tstruct T *left, *right;\n\tint val;\n} tree;\n\ntree *new( int n )\n{\n\ttree *r = ( tree * ) malloc( sizeof( tree ) );\n\tr->val = n;\n\tr->left = NULL;\n\tr->right = NULL;\n\treturn r;\n}\ntree *add( tree *root , int n )\n{\n\tif( !root )\n\t\treturn new( n );\n\telse\n\t\tif( root->val > n )\n\t\t\troot->left = add( root->left , n );\n\t\telse\n\t\t\troot->right = add( root->right , n );\n\treturn root;\n}\nvoid print( tree *t )\n{\n\tif( !t )\n\t\treturn;\n\tprint( t->left );\n\tprint( t->right );\n\tprintf( \"%d\\n\" , t->val );\n}\n\nint main()\n{\n\ttree *root = NULL;\n\tint n=0;\n\twhile( scanf( \"%d\" , &n ) == 1 )\n\t\troot = add( root , n );\n\tprint( root );\n\treturn 0;\n}\n",
"#include<stdio.h>\nlong int A[10101];\nvoid f(int b,int e){\nif(b==e)printf(\"%i\\n\",A[b]);\nif(b>=e)return;\nint nb=b;\nwhile(A[++nb]<A[b]&&nb<e);\nif(A[nb]<A[b]){\n\tf(b+1,nb);\n}else{\n\tf(b+1,nb-1);\n\tf(nb,e);\n}\nprintf(\"%i\\n\",A[b]);\n}\nint main(){\nint n=0;\nwhile(scanf(\"%i\",&A[n++])!=EOF);\nf(0,n-2);\nreturn 0;\n}\n\n"
],
"1_106015": [
"#include <stdio.h>\n\ntypedef struct {\n\tint d[500];\n\tint last;\n} big;\n\nbig f[1002], p[1002];\n\nvoid add(big* a, big* b, big* c)\n{\n\tint i;\n\tfor( i=a->last+1; i<=b->last; i++ ) a->d[i] = 0;\n\tint v, carry = 0;\n\tfor( i=0; i<=b->last; i++ )\n\t{\n\t\tv = a->d[i] + b->d[i] + carry;\n\t\tc->d[i] = v % 10;\n\t\tcarry = v / 10;\n\t}\n\tc->last = b->last;\n\tif ( carry ) c->d[ ++c->last ] = carry;\n}\n\nvoid mul(big* a, big* b)\n{\n\tint i;\n\tint v, carry = 0;\n\tfor( i=0; i<=a->last; i++ )\n\t{\n\t\tv = a->d[i]*2 + carry;\n\t\tb->d[i] = v % 10;\n\t\tcarry = v / 10;\n\t}\n\tb->last = a->last;\n\tif ( carry ) b->d[ ++b->last ] = carry;\n}\n\nvoid print(big* a)\n{\n\tint i;\n\tfor( i=a->last; i>=0; i-- )\n\t\tprintf(\"%d\", a->d[i]);\n\tprintf(\"\\n\");\n}\n\nint main()\n{\n\tf[0].d[ f[0].last = 0 ] = 0;\n\tf[1].d[ f[1].last = 0 ] = 0;\n\tp[0].d[ p[0].last = 0 ] = 1;\n\tp[1].d[ p[1].last = 0 ] = 1;\n\n\tint n;\n\tfor( n=1; n<1000; n++ )\n\t{\n\t\tadd( &f[n-1], &p[n-1], &f[n+1] );\n\t\tmul( &p[n], &p[n+1] );\n\t}\n\n\twhile( scanf(\"%d\", &n) != EOF )\n\t\tprint(&f[n]);\n\n\treturn 0;\n}\n\n",
"#define N 351\nint y[1001][N]={{0}},z[1001][N]={{0}}, i, c;\n\nvoid d(int j) {\n\tc=0;\n\tfor (i = 0; i < N; i++) {\n\t\ty[j+1][i]=(y[j][i]+z[j][i]+c)%10;\n\t\tc=(y[j][i]+z[j][i]+c)/10;\n\t}\n}\nvoid p(int j) {\n\tc=1-j%2;\n\tfor (i = 0; i < N; i++) {\n\t\tz[j][i]=(y[j][i]+c)%10;\n\t\tc=(y[j][i]+c)/10;\n\t}\n}\n\nvoid r(int n) {\n\tif (!n)\n\t\tn++;\n\tfor (i = N-1; i&&!z[n][i]; i--)\n\t\t;\n\tfor (;~i;i--)\n\t\tprintf(\"%d\",z[n][i]);\n\tprintf(\"\\n\");\n}\n\nmain(j) {\n\tfor (j = 0; j < 1001; j++) {\n\t\td(j);\n\t\tp(j+1);\n\t}\n\twhile (~scanf(\"%d\",&j))\n\t\tr(j);\n}",
"#define N 351\nint z[1001][N]={{0},{0}}, i, c;\n\nvoid d(int j) {\n\tc = j%2?1:-1;\n\tfor (i=0;i<N;i++){\n\t\tz[j+1][i]=(2*z[j][i]+c)%10;\n\t\tc=(2*z[j][i]+c)/10;\n\t}\n}\n\nvoid r(int n) {\n\tif (!n)\n\t\tn++;\n\tfor (i = N-1; i&&!z[n][i]; i--)\n\t\t;\n\tfor (;~i;i--)\n\t\tprintf(\"%d\",z[n][i]);\n\tprintf(\"\\n\");\n}\n\nmain(j) {\n\tfor (j = 1; j < 1000; j++)\n\t\td(j);\n\twhile (~scanf(\"%d\",&j))\n\t\tr(j);\n}"
],
"1_2124": [
"#include <stdio.h>\n\nint main()\n{\n\tchar plain[100], sub[100];\n\tchar buf[100];\n\tint i;\n\tchar map[256];\n\n\tgets(plain);\n\tgets(sub);\n\tfor( i=0; i<256; i++ )\n\t\tmap[i] = i;\n\tfor( i=0; plain[i]; i++ )\n\t\tmap[plain[i]] = sub[i];\n\n\tputs(sub);\n\tputs(plain);\n\twhile( gets(buf) )\n\t{\n\t\tfor( i=0; buf[i]; i++ )\n\t\t\tputchar( map[buf[i]] );\n\t\tputchar('\\n');\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n\n#define MAXLEN 70\n\nint index( char str[], char match );\nvoid getln( char line[] );\n\nvoid main() \n{ \n\tchar plain[MAXLEN], subst[MAXLEN], line[MAXLEN], c; \n\tint check; \n\t\n\tgetln( plain ); \n\tgetln( subst ); \n\tprintf( \"%s\\n\", subst ); \n\tprintf( \"%s\\n\", plain ); \n\n\twhile( (c = getchar()) != EOF )\n\t{ \n\t\tcheck = index( plain, c ); \n\t\tif( check != -1 )\n\t\t{\n\t\t\tputchar( subst[ check ] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tputchar( c ); \n\t\t}\n\t} \n}\n\nint index( char str[], char match )\n{\n\tint i = 0, ret = -1; \n\t\n\twhile( str[i] != '\\0' ) \n\t{ \n\t\tif( str[i] == match ) \n\t\t{ \n\t\t\tret = i;\n\t\t\tbreak; \n\t\t}\n\t\ti++; \n\t} \n\treturn ret;\n}\n\nvoid getln( char line[] )\n{ \t\n\tint i; \n\t\n\tfgets( line, MAXLEN-2, stdin ); \n\ti = strlen( line ); \n\tline[i-1] = '\\0'; \n}\n\n",
"#include <stdio.h>\n#include <string.h>\n\nint main() {\n\tint t, i;\n\tchar A[100], B[100];\n\n\t\tgets(A);\n\t\tgets(B);\n\t\tchar ASCII[128];\n\t\tint lenA = strlen(A), lenB = strlen(B);\n\t\tfor(i = 0; i < 128; i++)\n\t\t\tASCII[i] = i;\n\t\tfor(i = 0; i < lenA || i < lenB; i++) {\n\t\t\tif(i >= lenA)\tA[i] = ' ';\n\t\t\tif(i >= lenB)\tB[i] = ' ';\n\t\t\tASCII[A[i]] = B[i];\n\t\t}\n\t\tputs(B);\n\t\tputs(A);\n\t\twhile(gets(A)) {\n\t\t\tif(A[0] == '\\0')\n\t\t\t\tbreak;\n\t\t\tfor(i = 0; A[i]; i++) {\n\t\t\t\tprintf(\"%c\", ASCII[A[i]]);\n\t\t\t}\n\t\t\tputs(\"\");\n\t\t}\n\t\tif(t)\n\t\t\tputs(\"\");\n\t\n return 0;\n}"
],
"1_2175": [
"#include <stdio.h>\n\nint main()\n{\n\tint n;\n\tint a[3005], c[3005];\n\tint i;\n\n\twhile( scanf(\"%d\", &n) != EOF )\n\t{\n\t\tfor( i=1; i<n; i++ )\n\t\t\tc[i] = 0;\n\t\tfor( i=0; i<n; i++ )\n\t\t\tscanf(\"%d\", &a[i]);\n\t\tfor( i=1; i<n; i++ )\n\t\t\tif ( a[i] > a[i-1] ) c[ a[i]-a[i-1] ] = 1;\n\t\t\telse c[ a[i-1]-a[i] ] = 1;\n\t\tint jolly = 1;\n\t\tfor( i=1; i<n; i++ )\n\t\t\tif ( c[i] == 0 ) { jolly = 0; break; }\n\t\tputs( jolly ? \"Jolly\" : \"Not jolly\" );\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <strings.h>\n \n#define MAX 3000\nint table[MAX];\nint jolly(int seq[], int n)\n{\n int i;\n bzero(table, MAX*sizeof(int));\n for (i = 0; i < n - 1; ++i) {\n int d = abs(seq[i] - seq[i+1]);\n if (d > n - 1 || table[d])\n return 0;\n else\n table[d] = 1;\n }\n return 1;\n}\n \nint main(int argc, char *argv[])\n{\n#ifndef ONLINE_JUDGE\n char in[256];\n char out[256];\n strcpy(in, argv[0]);\n strcat(in, \".in\");\n freopen(in, \"r\", stdin);\n strcpy(out, argv[0]);\n strcat(out, \".out\");\n freopen(out, \"w\", stdout);\n#endif\n char *answer[] = {\n \"Not jolly\",\n \"Jolly\",\n };\n int i, n;\n int seq[MAX];\n while (scanf(\"%d\", &n) != EOF) {\n for (i = 0; i < n; ++i)\n scanf(\"%d\", &seq[i]);\n puts(answer[jolly(seq, i)]);\n } \n return 0;\n}",
"#include<stdio.h>\n#include<math.h>\n\nint main(int argc, char* argv[])\n{\nint i,j,k,n,a[3005];\nwhile(scanf(\"%d\",&n)!=EOF)\n{\nfor(i=0;i<n;i++) a[i]=0;\nscanf(\"%d\",&j);\nfor(i=1;i<n;i++)\n{\nscanf(\"%d\",&k);\na[abs(j-k)]=1;\nj=k;\n}\nfor(i=1;i<n;i++)\n{\nif(!a[i]) break;\n}\nif(i==n) printf(\"Jolly\\n\");\nelse printf(\"Not jolly\\n\");\n}\nreturn 0;\n}"
],
"1_101383": [
"// in the name of allah\n#include <string.h>\n#include <stdio.h>\n#define max(x, y) ((x<y)?(y):(x))\n#define min(x, y) ((x<y)?(x):(y))\n\nchar s1[1000], s2[1000];\nint S1, S2;\n\nint main()\n{\n\tint t1[26], t2[26], i, j, k, N, t=0;\n\tscanf(\"%d\", &N);\n\tgetc(stdin);\n\twhile(N--)\n\t{\n\t\tS1 = S2 = 0;\n\t\twhile((s1[S1++]=getc(stdin))!='\\n');\n\t\ts1[--S1] = 0;\n\t\twhile((s2[S2++]=getc(stdin))!='\\n');\n\t\ts2[--S2] = 0;\n\t\t\n\t\tmemset(t1, 0, sizeof(t1));\n\t\tmemset(t2, 0, sizeof(t2));\n\t\t\n\t\tfor(i = 0;i < S1;i++)\n\t\t\tt1[s1[i]-'a']++;\n\t\tfor(j = 0;j < S2;j++)\n\t\t\tt2[s2[j]-'a']++;\n\t\tint ans = 0;\n\t\tfor(i = 0;i < 26;i++)\n\t\t\tans += max(t1[i], t2[i]) - min(t1[i], t2[i]);\n\t\tprintf(\"Case #%d: %d\\n\", ++t, ans);\n\t}\n}\n",
"#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n#include<math.h>\nchar str1[200];\nchar str2[200];\nint f1[30];\nint f2[30];\nint main()\n{\nint n,i,j,len1,len2,count;\nscanf(\"%d\",&n);\ngetchar();\nfor(j=1;j<=n;j++){\n gets(str1);\n gets(str2);\n memset(f1,0,sizeof(f1));\n memset(f2,0,sizeof(f2));\n len1=strlen(str1);\n len2=strlen(str2);\n for(i=0;i<len1;i++){\n f1[str1[i]-'a']++;\n }\n for(i=0;i<len2;i++){\n f2[str2[i]-'a']++;\n }\n count=0;\n for(i=0;i<28;i++){\n count+=abs(f1[i]-f2[i]);\n }\n printf(\"Case #%d: %d\\n\",j,count);\n\n}\n \nreturn 0;\n}",
"#include<stdio.h>\n\nint main()\n{\n int i;\n char s1[200],s2[200],s3[100];\n char c;\n int a[26],b[26];\n unsigned int cases,cs=0,count;\n\n scanf(\"%d\\n\",&cases);\n while(cases--)\n {\n gets(s1);\n gets(s2);\n \n for(i=0;i<26;i++)\n {\n a[i]=0;\n b[i]=0;\n }\n\n \n for(i=0;s1[i];i++)\n a[s1[i]-'a']++;\n for(i=0;s2[i];i++)\n b[s2[i]-'a']++;\n \n count=0;\n \n for(i=0;i<26;i++)\n if(a[i]>b[i])\n count=count+a[i]-b[i];\n else if(a[i]<b[i])\n count=count+b[i]-a[i];\n \n printf(\"Case #%d: %d\\n\",++cs,count);\n }\n\nreturn 0;\n}"
],
"1_101164": [
"main()\n{\t\n\tfor(int d;scanf(\"%d\",&d),d+1;d=(d>90?450:90)-d,d%30?printf(\"Between %d o'clock and %d o'clock\\n\",d/30,(d/30+1)%12):printf(\"Exactly %d o'clock\\n\",d/30));\n}",
"#define Q printf(\nmain()\n{\t\n\tfor(int d;scanf(\"%d\",&d),d+1;d=(d>90?450:90)-d,d%30?Q \"Between %d o'clock and %d\",d/30,(d/30+1)%12):Q \"Exactly %d\",d/30),Q \" o'clock\\n\"));\n}",
"#define Q printf(\nmain()\n{\n\tfor(int d,c;scanf(\"%d\",&d),d+1;d=(d>90?450:90)-d,c=d/30,d%30?Q \"Between %d o'clock and\" ,c++):Q \"Exactly\"),Q \" %d o'clock\\n\",c%12));\n}",
"#define Q printf(\nmain()\n{\n\tfor(int d,c;scanf(\"%d\",&d),d+1;c=14-d/30,d%30?Q \"Between %d o'clock and\" ,c%12):Q \"Exactly\"),Q \" %d o'clock\\n\",++c%12));\n}",
"#include <stdio.h>\n\nint main()\n{\n\tint n;\n\twhile(1)\n\t{\n\t\tscanf(\"%d\", &n);\n\t\tif(n==-1)\n\t\t\tbreak;\n\n\t\tif(n>90)\n\t\t{\n\t\t\tn=360-n;\n\t\t\tif(n%30==0)\n\t\t\t\tprintf(\"Exactly %d o'clock\\n\", ((n/30) + 3)==12 ? 0 : (n/30) + 3);\n\t\t\telse\n\t\t\t\tprintf(\"Between %d o'clock and %d o'clock\\n\", (n/30)+3==12 ? 0 : (n/30)+3, (n/30)+4==12 ? 0 : (n/30)+4);\n\t\t}\n\t\telse if(n==90)\n\t\t\tprintf(\"Exactly 0 o'clock\\n\");\n\t\telse\n\t\t{\n\t\t\tif(n%30==0)\n\t\t\t\tprintf(\"Exactly %d o'clock\\n\", 3-(n/30)==12 ? 0 : 3-(n/30));\n\t\t\telse\n\t\t\t\tprintf(\"Between %d o'clock and %d o'clock\\n\", 3-(n/30)==12 ? 0 : 3-(n/30), 2-(n/30)==12 ? 0 : 2-(n/30));\n\t\t}\n\t}\n\treturn 0;\n}"
],
"1_1320": [
"#include<stdio.h>\n\nint main()\n{\n\tint flag=0,i,j,k,num,n,game=1;\n\tchar pat[5][5],data[105][76],ch;\n\n\twhile(1)\n\t{\n\t\tfor(i=0;i<5;i++)\n\t\t{\n\n\t\t\tfor(j=0;j<5;j++)\n\t\t\t{\n\t\t\t\tscanf(\"%c\",&ch);\n\t\t\t\tif(ch=='X')\n\t\t\t\t\tpat[i][j]=1;\n\t\t\t\telse\n\t\t\t\t\tpat[i][j]=0;\n\t\t\t}\n\t\t\tscanf(\"%c\",&ch);\n\t\t}\n\n\n\t\tscanf(\"%d\",&n);\n\t\t\n\t\tif(!n)\n\t\t\tbreak;\n\n\t\tif(flag)\n\t\t\tprintf(\"\\n\");\n\n\t\tfor(i=1;i<=n;i++)\n\t\t{\n\n\t\t\tfor(k=0;k<=75;k++)\n\t\t\t\tdata[i][k]=0;\n\n\t\t\tfor(k=0;k<5;k++)\n\t\t\t{\n\t\t\t\tfor(j=0;j<5;j++)\n\t\t\t\t{\n\t\t\t\t\tscanf(\"%d\",&num);\n\n\t\t\t\t\tif(pat[k][j])\n\t\t\t\t\t\tdata[i][num]=1;\n\t\t\t\t\telse\n\t\t\t\t\t\tdata[i][num]=0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprintf(\"Game %d\\n\",game);\n\n\t\tfor(i=1;i<=n;i++)\n\t\t{\n\n\t\t\tfor(j=1;j<i;j++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tfor(k=0;k<=75;k++)\n\t\t\t\t\tif(data[i][k]!=data[j][k])\n\t\t\t\t\t\tbreak;\n\n\t\t\t\tif(k==76)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\t\tif((j<i)&&k==76)\n\t\t\t\tprintf(\"Card %d is equivalent to card %d\\n\",i,j);\n\t\t}\n\n\t\tscanf(\"%c\",&ch);\n\t\tflag=1;\n\n\t\tgame++;\n\t}\n\n\treturn 0;\n\n}\n\t\t\t\t\n\n\n\n",
"#include<stdio.h>\n\nint main()\n{\n\tint flag=0,i,j,k,num,n,game=1;\n\tchar pat[5][5],data[105][76],ch;\n\n\twhile(1)\n\t{\n\t\tfor(i=0;i<5;i++)\n\t\t{\n\n\t\t\tfor(j=0;j<5;j++)\n\t\t\t{\n\t\t\t\tscanf(\"%c\",&ch);\n\t\t\t\tif(ch=='X')\n\t\t\t\t\tpat[i][j]=1;\n\t\t\t\telse\n\t\t\t\t\tpat[i][j]=0;\n\t\t\t}\n\t\t\tscanf(\"%c\",&ch);\n\t\t}\n\n\n\t\tscanf(\"%d\",&n);\n\t\t\n\t\tif(!n)\n\t\t\tbreak;\n\n\t\tif(flag)\n\t\t\tprintf(\"\\n\");\n\n\t\n\n\t\tprintf(\"Game %d\\n\",game);\n\n\t\tfor(i=1;i<=n;i++)\n\t\t{\n\t\t\tfor(k=0;k<=75;k++)\n\t\t\t\tdata[i][k]=0;\n\n\t\t\tfor(k=0;k<5;k++)\n\t\t\t{\n\t\t\t\tfor(j=0;j<5;j++)\n\t\t\t\t{\n\t\t\t\t\tscanf(\"%d\",&num);\n\n\t\t\t\t\tif(pat[k][j])\n\t\t\t\t\t\tdata[i][num]=1;\n\t\t\t\t\telse\n\t\t\t\t\t\tdata[i][num]=0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(j=1;j<i;j++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tfor(k=0;k<=75;k++)\n\t\t\t\t\tif(data[i][k]!=data[j][k])\n\t\t\t\t\t\tbreak;\n\n\t\t\t\tif(k==76)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\t\tif((j<i)&&k==76)\n\t\t\t\tprintf(\"Card %d is equivalent to card %d\\n\",i,j);\n\t\t}\n\n\t\tscanf(\"%c\",&ch);\n\t\tflag=1;\n\n\t\tgame++;\n\t}\n\n\treturn 0;\n\n}",
"#include<stdio.h>\nchar a[6][6];\nint z=1,n,i,j,k,l,m,p,b[100][6][6],eq,eqs;\nint main(){\nscanf(\"%s%s%s%s%s%d\",a[0],a[1],a[2],a[3],a[4],&n);\nwhile(n){\n\tif(z>1)printf(\"\\n\");\nprintf(\"Game %d\\n\",z);\nz++;\nfor(k=0;k<n;k++)\nfor(i=0;i<5;i++){\nfor(j=0;j<5;j++){\nscanf(\"%d\",&b[k][i][j]);\nif(a[i][j]=='_'){\nb[k][i][j]=0;\n}\n}\n}\nfor(k=0;k<n;k++)\nfor(l=0;l<k;l++){\n\teq=1;\nfor(i=0;i<5;i++){\nfor(j=0;j<5;j++){\n\neqs=0;\nfor(m=0;m<5;m++){\nfor(p=0;p<5;p++){\n\t\nif(b[k][i][j]==b[l][m][p]){\neqs=1;\nbreak;\n}\n\n}\nif(eqs)break;\n}\nif(!eqs)eq=0;\nif(!eq)break;\n\n}\n\nif(!eq)break;\n\n}\nif(eq){\nprintf(\"Card %d is equivalent to card %d\\n\",k+1,l+1);\t\nbreak;\n}\n}\t\n\n\nscanf(\"%s%s%s%s%s%d\",a[0],a[1],a[2],a[3],a[4],&n);\t\n}\t\n}",
"#include<stdio.h>\nchar a[6][6];\nint z=1,n,i,j,k,l,m,p,b[100][6][6],eq,eqs;\nint main(){\nscanf(\"%s%s%s%s%s%d\",a[0],a[1],a[2],a[3],a[4],&n);\nwhile(n){\n\tif(z>1)printf(\"\\n\");\nprintf(\"Game %d\\n\",z);\nz++;\nfor(k=0;k<n;k++)\nfor(i=0;i<5;i++){\nfor(j=0;j<5;j++){\nscanf(\"%d\",&b[k][i][j]);\nif(a[i][j]=='_'){\nb[k][i][j]=0;\n}\n}\n}\nfor(k=0;k<n;k++)\nfor(l=0;l<k;l++){\n\teq=1;\nfor(i=0;i<5;i++){\nfor(j=0;j<5;j++){\nif(b[k][i][j]==0)continue;\neqs=0;\nfor(m=0;m<5;m++){\nfor(p=0;p<5;p++){\n\t\nif(b[k][i][j]==b[l][m][p]){\neqs=1;\nbreak;\n}\n\n}\nif(eqs)break;\n}\nif(!eqs)eq=0;\nif(!eq)break;\n\n}\n\nif(!eq)break;\n\n}\nif(eq){\nprintf(\"Card %d is equivalent to card %d\\n\",k+1,l+1);\t\nbreak;\n}\n}\t\n\n\nscanf(\"%s%s%s%s%s%d\",a[0],a[1],a[2],a[3],a[4],&n);\t\n}\t\n}"
],
"1_1656": [
"#include<stdio.h>\n\n\nint main()\n{\n\tint a[20],i,count,x,j,n;\n\twhile(1)\n\t{\n\t\tscanf(\"%d\",&a[0]);\n\n\t\tif(a[0]==-1)\n\t\t\tbreak;\n\n\t\ti=1;\n\t\twhile(1)\n\t\t{\n\t\t\tscanf(\"%d\",&a[i]);\n\t\t\tif(a[i]==0)\n\t\t\t\tbreak;\n\t\t\ti++;\n\t\t}\n\n\t\tn=i;\n\n\n\t\tcount=0;\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tx=a[i]*2;\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t\tif(x==a[j])\n\t\t\t\t\tbreak;\n\n\t\t\tif(j<n)\n\t\t\t\tcount++;\n\t\t}\n\n\t\tprintf(\"%d\\n\",count);\n\t}\n\n\treturn 0;\n}\n",
"#include<stdio.h>\n\nint main()\n{\n\tint Num[200][20]={0} , j=0 ,p ,i, z=0,k , flag= 0 , counter;\n\t\n\t\n\twhile (1)\n\t{\n\t\tz=0;\n\t\twhile (1)\n\t\t{\n\t\t\tscanf(\"%d\",&Num[j][z]);\n\t\t\tif(Num[j][z] == 0)\n\t\t\t\tbreak;\n\t\t\tif(Num[j][z] == -1)\n\t\t\t{\n\t\t\t\tflag = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tz++;\n\t\t}\n\t\tj++;\n\t\tif(flag == 1)\n\t\t\tbreak;\n\t}\n\n\tfor (i = 0; i < j-1; i++)\n\t{\n\t\tp=0;\n\t\tcounter=0;\n\t\twhile( Num[i][p] != 0 )\n\t\t{\n\t\t\tfor(k=0 ; Num[i][k] != 0 ; k++ )\n\t\t\t{\n\t\t\t\tif( Num[i][p] *2 == Num[i][k])\n\t\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tp++;\n\t\t}\n\n\t\tprintf(\"%d\\n\",counter);\n\t}\n}\n",
"#include <stdio.h>\n#define N 16\n\nint main()\n{\n\tint numbers[N], i, j, count, temp, out;\n\twhile (1)\n\t{\n\t\tout = 0;\n\t\tcount = 0;\n\t\twhile (1) //read numbers\n\t\t{\n\t\t\tscanf(\"%d\", &temp);\n\t\t\tif (temp == -1)\n\t\t\t\treturn 0;\n\t\t\tif (temp == 0)\n\t\t\t\tbreak;\n\t\t\tnumbers[count] = temp;\n\t\t\tcount++;\n\t\t}\n\n\t\tfor (i = 0; i < count; i++) //find doubles\n\t\t{\n\t\t\tfor (j = 0; j < count; j++)\n\t\t\t{\n\t\t\t\tif (numbers[i] % 2 == 0 && numbers[i] / 2 == numbers[j])\n\t\t\t\t\tout++;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\", out); //print the result\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n\nint main()\n{\n\tint numbers[16], i, j, count, temp, out;\n\twhile (1)\n\t{\n\t\tout = 0;\n\t\tcount = 0;\n\t\twhile (1) //read numbers\n\t\t{\n\t\t\tscanf(\"%d\", &temp);\n\t\t\tif (temp == -1)\n\t\t\t\treturn 0;\n\t\t\tif (temp == 0)\n\t\t\t\tbreak;\n\t\t\tnumbers[count] = temp;\n\t\t\tcount++;\n\t\t}\n\n\t\tfor (i = 0; i < count; i++) //find doubles\n\t\t{\n\t\t\tfor (j = 0; j < count; j++)\n\t\t\t{\n\t\t\t\tif (numbers[i] % 2 == 0 && numbers[i] / 2 == numbers[j])\n\t\t\t\t\tout++;\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\", out); //print the result\n\t}\n\treturn 0;\n}"
],
"1_2499": [
"#include<stdio.h>\nint main()\n{\n\tint t,age,wei,str;\n\tscanf(\"%d%d%d\",&age,&wei,&str);\n\twhile(age){\n\t\tt=0;\n\t\tif(age<=30&&wei>=70&&str>=500){\n\t\t\tprintf(\"Mid-field\");\n\t\t\tt=1;\n\t\t} if(age<=26&&wei>=60&&str>=200){\n\t\t\tif(t)printf(\" \");\n\t\t\tprintf(\"Forward\");\n\t\t\tt=1;\n\t\t} if(age<=36&&wei>=80&&str>=300){\n\t\t\tif(t)printf(\" \");\n\t\t\tprintf(\"Defense\");\n\t\t\tt=1;\n\t\t}\n\t\t\n\t\tif(!t){\n\t\t\tprintf(\"No positions\");\n\t\t}\n\t\tprintf(\"\\n\");\n\t\tscanf(\"%d%d%d\",&age,&wei,&str);\n\t}\n\treturn 0;\n}\n",
"#include <stdlib.h>\n#include <stdio.h>\n\nint\nmain (int argc, char **argv)\n{\n int age, weight, strength, has_position;\n\n while (1)\n {\n has_position = 0;\n\n scanf (\"%d%d%d\", &age, &weight, &strength);\n if ((age == 0) && (weight == 0) && (strength == 0))\n return EXIT_SUCCESS;\n\n if ((age <= 30) && (weight >= 70) && (strength >= 500))\n {\n has_position = 1;\n printf (\"Mid-field\");\n }\n if ((age <= 26) && (weight >= 60) && (strength >= 200))\n {\n if (has_position)\n printf (\" \");\n else\n has_position = 1;\n printf (\"Forward\");\n }\n if ((age <= 36) && (weight >= 80) && (strength >= 300))\n {\n if (has_position)\n printf (\" \");\n else\n has_position = 1;\n printf (\"Defense\");\n }\n if (has_position == 0)\n printf (\"No positions\");\n printf (\"\\n\");\n }\n return EXIT_SUCCESS;\n}\n",
"#include<stdio.h>\nint main()\n{\n\tint t,age,wei,str;\n\tscanf(\"%d%d%d\",&age,&wei,&str);\n\twhile(age){\n\t\tt=0;\n\t\tif(age<=30&&wei>=70&&str>=500){\n\t\t\tprintf(\"Mid-field\");\n\t\t\tt=1;\n\t\t} if(age<=26&&wei>=60&&str>=200){\n\t\t\tif(t)printf(\" \");\n\t\t\tprintf(\"Forward\");\n\t\t\tt=1;\n\t\t} if(age<=36&&wei>=80&&str>=300){\n\t\t\tif(t)printf(\" \");\n\t\t\tprintf(\"Defense\");\n\t\t\tt=1;\n\t\t}\n\t\t\n\t\tif(!t){\n\t\t\tprintf(\"No positions\");\n\t\t}\n\t\tprintf(\"\\n\");\n\t\tscanf(\"%d%d%d\",&age,&wei,&str);\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n\nint main()\n{\n\tint age, weight, strength, seprator;\n\n\twhile(1)\n\t{\n\t\tseprator=0;\n\t\tscanf(\"%d%d%d\", &age, &weight, &strength);\n\t\tif(age==0 && weight==0 && strength==0)\n\t\t\tbreak;\n\n\t\tif( age<=30 && weight>=70 && strength>=500)\n\t\t{\n\t\t\tprintf(\"Mid-field\");\n\t\t\tseprator=1;\n\t\t}\n\n\t\tif( age<=26 && weight>=60 && strength>=200)\n\t\t{\n\t\t\tif(seprator)\n\t\t\t\tprintf(\" \");\n\t\t\tprintf(\"Forward\");\n\t\t\tseprator=1;\n\t\t}\n\n\t\tif( age<=36 && weight>=80 && strength>=300)\n\t\t{\n\t\t\tif(seprator)\n\t\t\t\tprintf(\" \");\n\t\t\tprintf(\"Defense\");\n\t\t\tseprator=1;\n\t\t}\n\n\t\tif(!seprator)\n\t\t\tprintf(\"No positions\");\n\n\t\tprintf(\"\\n\");\n\t}\n\treturn 0;\n}",
"#include<stdio.h>\n\nint main()\n{\n\tfloat s[300];\n\tint w[300] , S[300] , temp ,flag;\n\tint j =0 , i,z;\n\n\twhile (1)\n\t{\n\t\tscanf(\"%f\", &s[j] );\n\t\tscanf(\"%d\", &w[j] );\n\t\tscanf(\"%d\", &S[j] );\n\n\t\tif(s[j]==0 && w[j]==0 && S[j]==0)\n\t\t\tbreak;\n\t\tj++;\n\t}\n\n\tfor (i = 0; i < j; i++)\n\t{\n\t\tflag =0;\n\t\tif(s[i] <= 30 && w[i]>=70 && S[i]>=500 )\n\t\t{\n\t\t\tif(flag ==1 )\n\t\t\t\tprintf(\" \");\n\t\t\tflag=1;\n\t\t\tprintf(\"Mid-field\");\n\t\t}\n\t\tif(s[i] <= 26 && w[i]>=60 && S[i]>=200 )\n\t\t{\n\t\t\tif(flag ==1 )\n\t\t\t\tprintf(\" \");\n\t\t\tflag=1;\n\t\t\tprintf(\"Forward\");\n\t\t}\n\t\tif(s[i] <= 36 && w[i]>=80 && S[i]>=300 )\n\t\t{\n\t\t\tif(flag ==1 )\n\t\t\t\tprintf(\" \");\n\t\t\tflag=1;\n\t\t\tprintf(\"Defense\");\n\t\t}\n\t\tif(flag ==0 )\n\t\t\tprintf(\"No positions\");\n\t\tprintf(\"\\n\");\n\n\t}\n}",
"#include <stdio.h>\n\nint forward(int, int, int);\nint middle(int, int, int);\nint defence(int, int, int);\nvoid Print(int, int, int);\n\nint main()\n{\n\n\tint age, weight, strength;\n\tdo\n\t{\n\t\tint f, m, d;\n\n\t\tscanf(\"%d %d %d\", &age, &weight, &strength);\n\t\tif(age == 0 && weight == 0 && strength == 0)\n break;\n\n\t\tf = forward(age, weight, strength);\n\t\tm = middle(age, weight, strength);\n\t\td = defence(age, weight, strength);\n\t\tPrint(f, m, d);\n\n\t\tprintf(\"\\n\");\n\t} while (weight != 0 && age != 0 && strength != 0);\n\treturn 0;\n}\nint forward(int age, int weight, int strength)\n{\n\tif (age <= 26 && weight >= 60 && strength >= 200)\n\t\treturn 1;\n if (age == 0 && weight == 0 && strength == 0)\n return 0;\n\treturn 5;\n}\n\nint middle(int age, int weight, int strength)\n{\n\tif (age <= 30 && weight >= 70 && strength >= 500)\n\t\treturn 1;\n if (age == 0 && weight == 0 && strength == 0)\n return 0;\n\treturn 5;\n}\n\nint defence(int age, int weight, int strength)\n{\n\tif (age <= 36 && weight >= 80 && strength >= 300)\n\t\treturn 1;\n if (age == 0 && weight == 0 && strength == 0)\n return 0;\n\treturn 5;\n}\n\nvoid Print(int f, int m, int d)\n{\n int x;\n x = 0;\n if (m == 1)\n\t{\n\t printf(\"Mid-field\");\n\t x++ ;\n\t}\n\n\tif (f == 1)\n\t{\n\t if(x == 1)\n\t {\n\t printf(\" \");\n\t }\n\t printf(\"Forward\");\n\t x++ ;\n\t}\n\tif (d == 1)\n\t{\n\t if(x== 1 || x== 2)\n\t printf(\" \");\n\t printf(\"Defense\");\n\t}\n\tif (f == 5 && m == 5 && d == 5)\n\t\tprintf(\"No positions\");\n}\n\n"
],
"1_1324": [
"#include<stdio.h>\n#include<string.h>\nint stlen(char str[]){\nint i=0;\nwhile(str[i])i++;\nreturn i;\n}\nint main(){\nchar str[30],inp[2],tmp;\nint T=0,c,i,j,intstrlen;\nwhile(scanf(\"%s\",str)&&strcmp(str,\"STOP\")){\n\tif(T++)printf(\"\\n\");\n\tprintf(\"Dataset #%d: The initial order is %s.\\n\",T,str);\n\tscanf(\"%d\",&c);\n\twhile(c--){\n\t\t\n\t\tscanf(\"%s\",inp);\n\t\tintstrlen=stlen(str);\n\t\t\tfor(i=0;i<intstrlen;i++){\n\t\t\t\tif(str[i]==inp[0]){\n\t\t\t\t\tif(i>intstrlen/2||(i==intstrlen/2&&intstrlen%2==0)){\n\t\t\t\t\t\tfor(j=1;j<=(intstrlen-i)/2;j++){\n\t\t\t\t\t\t\ttmp=str[i+j];\n\t\t\t\t\t\t\tstr[i+j]=str[intstrlen-j];\n\t\t\t\t\t\t\tstr[intstrlen-j]=tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(j=i;j<intstrlen;j++)\n\t\t\t\t\t\tstr[j]=str[j+1];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfor(j=1;j<=i/2;j++){\n\t\t\t\t\t\t\ttmp=str[i-j];\n\t\t\t\t\t\t\tstr[i-j]=str[j-1];\n\t\t\t\t\t\t\tstr[j-1]=tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(j=i;j<intstrlen;j++)\n\t\t\t\t\t\tstr[j]=str[j+1];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\tprintf(\"After %c leaves, the order is %s.\\n\",inp[0],str);\n\n\t}\n\n}\nreturn 0;\n}\n",
"#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint tries,count=1,len;\n\tchar *buffer,car,alaki[200];\n\tbuffer=(char*)malloc(sizeof(char)*1024*1024*10);\n\twhile(1)\n\t{\n\t\tgets(buffer);\n\t\tif(strcmp(buffer,\"STOP\")==0)\n\t\t\tbreak;\n\t\tif(count>1)\n\t\t\tprintf(\"\\n\");\n\t\tprintf(\"Dataset #%d: The initial order is %s.\\n\",count++, buffer);\n\t\tgets(alaki);\n\t\ttries=atoi(alaki);\n\t\tlen=strlen(buffer);\n\t\twhile(tries--)\n\t\t{\n\t\t\tgets(alaki);\n\t\t\tcar=alaki[0];\n\t\t\tfor(int i=0;i<len;i++)\n\t\t\t{\n\t\t\t\tif(buffer[i]==car)\n\t\t\t\t{\n\t\t\t\t\tint j=i+1;\n\t\t\t\t\twhile(buffer[j])\n\t\t\t\t\t{\n\t\t\t\t\t\tbuffer[j-1]=buffer[j];\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[j-1]='\\0';\n\t\t\t\t\tlen--;\n\t\t\t\t\tint tmp;\n\t\t\t\t\tif(i==0 || i==len)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t\telse if(i>len-i)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int j=0;j<=(len-i-1)/2;j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttmp=buffer[i+j];\n\t\t\t\t\t\t\tbuffer[i+j]=buffer[len-j-1];\n\t\t\t\t\t\t\tbuffer[len-j-1]=tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int j=0;j<i/2;j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttmp=buffer[j];\n\t\t\t\t\t\t\tbuffer[j]=buffer[i-j-1];\n\t\t\t\t\t\t\tbuffer[i-j-1]=tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tprintf(\"After %c leaves, the order is %s.\\n\",car,buffer);\n\t\t}\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint tries,count=1,len;\n\tchar *buffer,car,alaki[200];\n\tbuffer=(char*)malloc(sizeof(char)*1024*512);\n\twhile(1)\n\t{\n\t\tgets(buffer);\n\t\tif(strcmp(buffer,\"STOP\")==0)\n\t\t\tbreak;\n\t\tif(count>1)\n\t\t\tprintf(\"\\n\");\n\t\tprintf(\"Dataset #%d: The initial order is %s.\\n\",count++, buffer);\n\t\tgets(alaki);\n\t\ttries=atoi(alaki);\n\t\tlen=strlen(buffer);\n\t\twhile(tries--)\n\t\t{\n\t\t\tgets(alaki);\n\t\t\tcar=alaki[0];\n\t\t\tfor(int i=0;i<len;i++)\n\t\t\t{\n\t\t\t\tif(buffer[i]==car)\n\t\t\t\t{\n\t\t\t\t\tint j=i+1;\n\t\t\t\t\twhile(buffer[j])\n\t\t\t\t\t{\n\t\t\t\t\t\tbuffer[j-1]=buffer[j];\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\tbuffer[j-1]='\\0';\n\t\t\t\t\tlen--;\n\t\t\t\t\tint tmp;\n\t\t\t\t\tif(i==0 || i==len)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t\telse if(i>len-i)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int j=0;j<=(len-i-1)/2;j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttmp=buffer[i+j];\n\t\t\t\t\t\t\tbuffer[i+j]=buffer[len-j-1];\n\t\t\t\t\t\t\tbuffer[len-j-1]=tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int j=0;j<i/2;j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttmp=buffer[j];\n\t\t\t\t\t\t\tbuffer[j]=buffer[i-j-1];\n\t\t\t\t\t\t\tbuffer[i-j-1]=tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tprintf(\"After %c leaves, the order is %s.\\n\",car,buffer);\n\t\t}\n\t}\n\treturn 0;\n}"
],
"1_1099": [
"#include<stdio.h>\n\nvoid main()\n{\n\tint n;\n\tfor(int k=1;;k++)\n\t{\n\t\tscanf(\"%d\",&n);\n\t\tif(n==0) break;\n\t\tint div,h[50];\n\t\tlong brk=0,mvs=0,r;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tscanf(\"%d\",&h[i]);\n\t\t\tbrk=brk+h[i];\n\t\t}\n\tdiv=brk/n;\n\tfor(int j=0;j<n;j++)\n\t\tif((div-h[j])>0) mvs=mvs+div-h[j];\n\tprintf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",k,mvs);\n\t}\n}",
"#include <stdio.h>\nint main(){\n\tint i,j=0,n,a[50],sum,avg;\n\twhile(1){\n\t\tscanf(\"%d\",&n);\n\t\tif(n==0)break;\n\t\tsum=0;\n\t\tfor(i=0;i<n;i++){\n\t\t\tscanf(\"%d\",&a[i]);\n\t\t\tsum+=a[i];\n\t\t}\n\t\tavg=sum/n;\n\t\tsum=0;\n\t\tfor(i=0;i<n;i++){\n\t\t\tif(a[i]>avg)sum+=a[i]-avg;\n\t\t}\n\t\tprintf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",++j,sum);\n\t}\n}\n",
"#include<stdio.h>\n\nvoid main()\n{\n\tint n;\n\tfor(int k=1;;k++)\n\t{\n\t\tscanf(\"%d\",&n);\n\t\tif(n==0) break;\n\t\tint div,h[50];\n\t\tlong brk=0,mvs=0,r;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tscanf(\"%d\",&h[i]);\n\t\t\tbrk=brk+h[i];\n\t\t}\n\tdiv=brk/n;\n\tfor(int j=0;j<n;j++)\n\t\tif((div-h[j])>0) mvs=mvs+div-h[j];\n\tprintf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",k,mvs);\n\t}\n}",
"#include<stdio.h>\n\nvoid main()\n{\n\tint n;\n\tfor(int k=1;;k++)\n\t{\n\t\tscanf(\"%d\",&n);\n\t\tif(n==0) break;\n\t\tint div,h[50];\n\t\tlong brk=0,mvs=0,r;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tscanf(\"%d\",&h[i]);\n\t\t\tbrk=brk+h[i];\n\t\t}\n\tdiv=brk/n;\n\tfor(int j=0;j<n;j++)\n\t\tif((div-h[j])>0) mvs=mvs+div-h[j];\n\tprintf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",k,mvs);\n\t}\n}",
"#include <stdio.h>\nint main()\n{\n int n, i, s, aver, a[51], num, j = 0;\n while(scanf(\"%d\", &n)!=EOF)\n {\n if(n == 0) break;\n j++;\n s = 0;\n num = 0;\n for(i = 0; i < n; i++)\n {\n scanf(\"%d\", &a[i]);\n s = s + a[i];\n }\n aver = s / n;\n for(i = 0; i < n; i++)\n {\n if(a[i] > aver)\n {\n num = num + a[i] - aver;\n }\n }\n printf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\", j, num);\n }\n return 0;\n}",
"#include <stdio.h>\nint main(){\n int n,*st;\n int sum,i;\n int set=0;\n while(1){\n set++;\n scanf(\"%d\",&n);\n if(!n)break;\n st=(int*)malloc(sizeof(int)*n);\n sum=0;\n for(i=0;i<n;i++){\n scanf(\"%d\",&st[i]);\n sum+=st[i];\n }\n int avg=sum/n;\n int ans=0;\n for(i=0;i<n;i++){\n if(st[i]>avg){\n ans+=st[i]-avg;\n }\n }\n printf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",set,ans);\n }\n\treturn 0;\n}\n",
"#include<stdio.h>\n\nvoid main()\n{\n\tint n;\n\tfor(int k=1;;k++)\n\t{\n\t\tscanf(\"%d\",&n);\n\t\tif(n==0) break;\n\t\tint div,h[50];\n\t\tlong brk=0,mvs=0,r;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tscanf(\"%d\",&h[i]);\n\t\t\tbrk=brk+h[i];\n\t\t}\n\tdiv=brk/n;\n\tfor(int j=0;j<n;j++)\n\t\tif((div-h[j])>0) mvs=mvs+div-h[j];\n\tprintf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",k,mvs);\n\t}\n}",
"#include<stdio.h>\n\nvoid main()\n{\n\tint n;\n\tfor(int k=1;;k++)\n\t{\n\t\tscanf(\"%d\",&n);\n\t\tif(n==0) break;\n\t\tint div,h[50];\n\t\tlong brk=0,mvs=0,r;\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tscanf(\"%d\",&h[i]);\n\t\t\tbrk=brk+h[i];\n\t\t}\n\tdiv=brk/n;\n\tfor(int j=0;j<n;j++)\n\t\tif((div-h[j])>0) mvs=mvs+div-h[j];\n\tprintf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",k,mvs);\n\t}\n}",
"#include <stdio.h>\n\nint main()\n{\n int n, j=0;\n\n while (1)\n {\n scanf(\"%d\", &n);\n if (n==0)\n break;\n int b[n], sum=0, i, out=0;\n for (i = 0; i<n; i++)\n {\n scanf(\"%d\", &b[i]);\n sum += b[i];\n\n }\n sum = sum/n;\n\n for (i = 0; i < n; i++)\n {\n if (b[i] > sum)\n out += (b[i] - sum);\n }\n j++;\n printf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\", j, out);\n }\n return 0;\n}\n",
"#include <stdio.h>\n\nint main()\n{\n int k=1,n,i,col,sum=0,avg,j,min=0;\n while(1){\n\n min=0;\n sum=0;\n avg=0;\n scanf(\"%d\" , &n);\n if(n==0)\n break;\n int arr[n];\n for(i=0;i<n;i++){\n\n scanf(\"%d\", & col);\n arr[i]=col;\n sum+=col;\n }\n avg=(sum/n);\n\n for(j=0;j<n;j++){\n if (arr[j]>avg){\n min+=arr[j]-avg;\n }\n\n }\n\n printf(\"Set #%d\\n\", k);\n printf(\"The minimum number of moves is %d.\\n\\n\", min);\n\n k++;\n\n }\n return 0;\n}\n\n",
"//Problem c: Box of Bricks\n#include <stdio.h>\n\nint main()\n{\n int n, j=0;\n\n while (1)\n {\n scanf(\"%d\", &n);\n if (n==0)\n break;\n int b[n], sum=0, i, out=0;\n for (i = 0; i<n; i++)\n {\n scanf(\"%d\", &b[i]);\n sum += b[i];\n\n }\n sum = sum/n;\n\n for (i = 0; i < n; i++)\n {\n if (b[i] > sum)\n out += (b[i] - sum);\n }\n j++;\n printf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\", j, out);\n }\n return 0;\n}\n",
"#include <stdio.h>\n\nint main()\n{ int n , j=0;\n while(1)\n {\n scanf(\"%d\", &n);\n if (n==0)\n break;\n int b[n],sum=0 , i , moves=0;\n for (i = 0; i<n; i++)\n {\n scanf(\"%d\",& b[i]);\n sum+=b[i];\n }\n sum= sum/n;\n for (i=0;i<n;i++)\n {\n if(b[i]>sum)\n moves+= b[i]-sum;\n }\n j++;\n printf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",j,moves);\n }\n\n return 0;\n}\n",
"#include <stdio.h>\n\nint main()\n{ int n , j=1;\n while(1)\n {\n scanf(\"%d\", &n);\n if (n==0)\n break;\n int b[n],sum=0 , i , m=0;\n for (i = 0; i<n; i++)\n {\n scanf(\"%d\",& b[i]);\n sum+=b[i];\n }\n sum= sum/n;\n for (i=0;i<n;i++)\n {\n if(b[i]>sum)\n m+= b[i]-sum;\n }\n \n printf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\",j++,m);\n }\n\n return 0;\n}\n",
"//Problem c: Box of Bricks\n#include <stdio.h>\n\nint main()\n{\n int n, j=0;\n\n while (1)\n {\n scanf(\"%d\", &n);\n if (n==0)\n break;\n int b[n], sum=0, i, out=0;\n for (i = 0; i<n; i++)\n {\n scanf(\"%d\", &b[i]);\n sum += b[i];\n }\n sum = sum/n;\n\n for (i = 0; i < n; i++)\n {\n if (b[i] > sum)\n out += (b[i] - sum);\n }\n j++;\n printf(\"Set #%d\\nThe minimum number of moves is %d.\\n\\n\", j, out);\n }\n return 0;\n}\n"
],
"1_2713": [
"#include <stdio.h>\n\nint main ()\n{\n\tint s=1;\n\tint a;\n\tscanf(\"%d\",&a);\n\twhile (a!=0)\n\t{\n\t\ts=1;\n\t\twhile (a!=1)\n\t\t{\n\t\t\tif (a%2==0)\n\t\t{\n\t\t\ta=a/2;\n\t\t\ts++;\n\t\t}\n\t\telse \n\t\t{\n\t\t\ta=(3*a)+1;\n\t\t\ts++;\n\t\t}\n //cout <<s<<endl;\n\t\t}\n\t\tprintf(\"%d\\n\",s); \n\t scanf(\"%d\",&a);\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\nint main(){\nlong n;\nint k;\nwhile(1){\nscanf(\"%d\",&n);\nif(n==0)break;\nk=1;\nwhile(n!=1){\nif(n%2==0){\n n/=2;\n\t\n}else{\n\tn=3*n+1;\n}\nk++;\n}\nprintf(\"%d\\n\",k);\n}\n}",
"#include<stdio.h>\nint main()\n{\n int i=0,j=0,k=0,l,a[100],b[100],n;\n \n scanf(\"%d\",&n);\n\t\t\n\t\twhile(n!=0)\n\t{\n\t\ta[j]=n;\n\t\tif(n==1)\n\t\t\tk=1;\n\t\t\n while(a[j]!=1)\n\t {\n if ((a[j]%2)==0)\n {\n\t\t\ta[j] /= 2;\n\t\t\tk++;\n }\n else\n {\n\t\t a[j]=(3*a[j])+1;\n\t\t\tk++;\n } \n }\n\t \n\t\tb[j]=k;\n\t j++;\n\t k=1;\n\t\tscanf(\"%d\",&n);\n\n\t }\n\tfor (l=0; l<j; l++)\n {\n printf(\"%d\\n\",b[l]); \n }\n \n \n return 0;\n \n}\n\n",
"#include <stdio.h>\n\nint main ()\n{\n int set_len[100] , num , cou = 0 , num_1 , set_len_con = 0 ,num_con = 0 , i;\n\n scanf(\"%d\", &num);\n\n while( num != 0 )\n {\n\n\n while( num != 1)\n {\n\n if( num % 2 != 0 )\n {\n num = ( num * 3 ) + 1;\n }\n else\n {\n num = num / 2 ;\n }\n\n set_len_con++;\n }\n\n set_len[num_con] = set_len_con + 1;\n\n num_con++;\n\n //scanf\n scanf(\"%d\" , &num );\n\n set_len_con = 0;\n\n\n }\n\n for ( i = 0 ; i < num_con ; i++)\n {\n printf(\"%d\\n\", set_len[i]);\n }\n\n\n}\n",
" \n#include <stdio.h>\nint main ()\n{\n int i=0,k=0;\n int a,c=0,d[101]={0};\n scanf(\"%d\",&a);\n if (a==1)\n {\n d[i]=1;\n i++;\n }\n while (1)\n {\n if(a==0)\n break;\n \n else if(a%2==0)\n {\n a=a/2;\n c++;\n if (a==1)\n {\n d[i]=c+1;\n i++;\n c=0;\n scanf(\"%d\",&a);\n if (a==1)\n {\n d[i]=1;\n i++;\n }\n } \n }\n else if (a!=1)\n \n {\n \n a=(3*a)+1;\n c++;\n } \n else\n scanf(\"%d\",&a);\n}\n\nfor(k=0;d[k]!=0;k++)\n{\nprintf(\"%d\\n\",d[k]);\n} \n return 0;\n }\n",
"#include <stdio.h>\nint main(){\nlong n;\nint k;\nwhile(1){\nscanf(\"%d\",&n);\nif(n==0)break;\nk=1;\nwhile(n!=1){\nif(n%2==0){\n\tn/=2;\n}else{\n\tn=3*n+1;\n}\nk++;\n}\nprintf(\"%d\\n\",k);\n}\n}\n\n",
"#include<stdio.h>\n\nint main()\n{\n\tchar temp ;\n\tint i,j=0,num,p,q ,b[500];\n\n\twhile (1)\n\t{\n\t\tscanf(\"%d\",&b[j]);\n\t\tif(b[j] == 0)\n\t\t\tbreak;\n\t\tj++;\n\t}\n\tfor (i = 0; i < j; i++)\n\t{\n\t\tp=1;\n\t\twhile (b[i] != 1)\n\t\t{\n\t\t\tif(b[i]%2 == 0)\n\t\t\t{\n\t\t\t\tb[i] /=2 ;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb[i] = (3*b[i]) +1;\n\t\t\t}\n\t\t\tp++;\n\t\t}\n\t\tprintf(\"%d\\n\",p);\n\t}\n\n}",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n int x, i, l=1;\n scanf(\"%d\", &x);\n do\n {\n for(i=0 ; ; i++)\n {\n if(x == 1)\n break;\n if(x % 2 != 0)\n {\n x = (3 * x) + 1;\n l++ ;\n }\n if(x % 2 == 0)\n {\n x = x / 2;\n l++ ;\n }\n }\n printf(\"%d\\n\", l);\n l = 1;\n scanf(\"%d\", &x);\n\n } while(x != 0);\n return 0;\n}\n",
"//https://sharecode.io/contests/problem/61839685/A\n\n#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n int x, i, l=1;\n scanf(\"%d\", &x);\n do\n {\n for(i=0 ; ; i++)\n {\n if(x == 1)\n break;\n if(x % 2 != 0)\n {\n x = (3 * x) + 1;\n l++ ;\n }\n if(x % 2 == 0)\n {\n x = x / 2;\n l++ ;\n }\n }\n printf(\"%d\\n\", l);\n l = 1;\n scanf(\"%d\", &x);\n\n } while(x != 0);\n return 0;\n}\n"
],
"1_2429": [
" #include<stdio.h>\n #include<math.h>\n #include<ctype.h>\n #define big unsigned long long int\n int p[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709};\n //const int lim=sizeof(p)/sizeof(p[0]);\n int i=3;int flag,pom;\n int sum=1,t,temp,n;\n big root;\n int read()\n {\n int ans=0;\n char ch=getchar_unlocked();\n while(isdigit(ch))\n {\n ans=(ans<<3)+(ans<<1)+ch-'0';\n ch=getchar_unlocked();\n }\n return ans;\n }\n int maxp(int n,int a )\n {\n int count =0;\n while((n%a)==0)\n {\n count++;\n n/=a;\n }\n return count;\n }\n big powe(int a,int n)\n {\n big ans=1;int i;\n for( i=0;i<n;i++)\n ans*=a;\n return ans;\n }\n int main()\n {\n #ifndef ONLINE_JUDGE\n // freopen(\"in.txt\",\"w\",stdout);\n // int u=0;\n // printf(\"%d\\n\",500000);\n // for(u=1;u<=500000;u++)\n // printf(\"%d\\n\",u);\n freopen(\"out.txt\",\"w\",stdout);\n freopen(\"in.txt\",\"r\",stdin);\n #endif\n t=read();\n while(t--)\n {\n n=read();\n temp=n;\n if(n==1)\n {\n printf(\"%d\\n\",0);\n }\n else{\n root=sqrt(temp);\n flag=0;\n for(i=0;p[i]<=root;i++)\n {\n if((n%p[i])==0)\n {\n flag=1;\n break;\n }\n }\n if(!flag)\n {\n printf(\"%d\\n\",1);\n }\n else\n {\n sum=1;\n root=sqrt(n);\n for(i=0;p[i]<=root;i++)\n {\n if((temp%p[i])==0)\n {\n pom=maxp(n,p[i]);\n n/=powe(p[i],pom);\n sum=sum*(powe(p[i],pom+1)-1)/(p[i]-1);\n root=sqrt(n);\n }\n // cout<<p[i]<<\" \"<<po[i]<<\"n is \"<<n<<endl;\n }\n if(n!=1)\n {\n sum*=(powe(n,2)-1)/(n-1);\n //cout<<\"here n !=1\"<<endl;\n }\n temp=sum-temp;\n printf(\"%d\\n\",temp);\n }\n }\n }\n return 0;\n } ",
"main(i,j){ \n\tint a[500001] = {0};\n\tfor(i=1;i<250001;i++ ) for(j=2;i*j<500001;j++) a[i*j]+=i; \n\tscanf(\"%d\",&i);\n\twhile(scanf(\"%d\",&j), i--) printf(\"%d\\n\",a[j]);\n}",
"main(){ \n\tint a[500001] = {0} ;\n\tint i,j;\n\tfor(i=1;i<=250000;i++ ) for(j=2;i*j<= 500000;j++) a[i*j]+=i; \n\tscanf(\"%d\",&i) ;\n\twhile(i--) {\n\t\tscanf(\"%d\",&j);\n\t\tprintf(\"%d\\n\",a[j]);\n\t}\n}",
"int i,j,a[500001];\nmain(){ \n\tfor(i=1;i<=250000;i++) for(j=2;i*j<= 500000;j++) a[i*j]+=i; \n\tscanf(\"%d\",&i) ;\n\twhile(i--) {\n\t\tscanf(\"%d\",&j);\n\t\tprintf(\"%d\\n\",a[j]);\n\t}\n}",
"int i,j,a[500001];\nmain(){ \n\tfor(i=1;i<250001;i++) for(j=2;i*j< 500001;j++) a[i*j]+=i; \n\tscanf(\"%d\",&i) ;\n\twhile(i--) {\n\t\tscanf(\"%d\",&j);\n\t\tprintf(\"%d\\n\",a[j]);\n\t}\n}",
"/*int i,j,a[500000];\nmain()\n{\n\tfor(; ++i < 25e4;)\n\t\tfor(j=1; 41i*++j < 5e5;a[i*j] += i);\t\t\t\t\n\tfor(scanf(\"%d\",&i);i--, scanf(\"%d\",&j);printf(\"%d\\n\",a[j]));\n}int i,j,1;\nmain()\n{\n\tfor(hjk 25e4;)}int i,j,a[500000];\nmain()\n{\n\tfor(; ++i < 25e789k7k4;)\n\t\tor(j=1; i*++j < i*++j < i*++j < i*++j < i*++j < \n\t\t+j < i*++j <<<<<<<<<<56yh i*++j\n\t\tf(tjtyjt%d\",&j);printf(\"%d\\n\",a[j]));\n}*/\nint i,j,a[500001];\nmain()\n{\n\tfor(j=1;j<1000;j++);\t\t\n\tfor(; ++i < 3e5;)\n\t\tfor(j=1; i*++j <= 5e5;a[i*j] += i);\t\t\t\t\n\tfor(scanf(\"%d\",&i);i--; scanf(\"%d\",&j),printf(\"%d\\n\",a[j]));\n}",
"int i,j,a[500001];\nmain()\n{\t\t\n\tfor(; ++i < 3e5;)\n\t\tfor(j=1; i*++j <= 5e5;a[i*j] += i);\t\t\t\t\n\tfor(scanf(\"%d\",&i);i--; scanf(\"%d\",&j),printf(\"%d\\n\",a[j]));\n}",
"#define S scanf(\"%d\",\nint i,a[500001];\nmain(j)\n{\n\tfor(; ++i < 3e5;)\n\t\tfor(j=1; i*++j <= 5e5;a[i*j] += i);\t\t\t\t\n\tfor(S&i);i--;S&j),printf(\"%d\\n\",a[j]));\n}",
"int i,j,a[500001];\nmain(){ \n\tfor(i=1;i<350000;i++) for(j=2;i*j< 500001;j++) a[i*j]+=i; \n\tscanf(\"%d\",&i) ;\n\twhile(i--) {\n\t\tscanf(\"%d\",&j);\n\t\tprintf(\"%d\\n\",a[j]);\n\t}\n}",
"int i,j,a[500001];\nmain(){ \n\tfor(i=1;i<35e4;i++) for(j=2;i*j< 500001;j++) a[i*j]+=i; \n\tscanf(\"%d\",&i) ;\n\twhile(i--) {\n\t\tscanf(\"%d\",&j);\n\t\tprintf(\"%d\\n\",a[j]);\n\t}\n}",
"int i,j,a[500001];\nmain(){ \n\tfor(i=1;i<35e4;i++) for(j=2;i*j<= 5e5;j++) a[i*j]+=i; \n\tscanf(\"%d\",&i) ;\n\twhile(i--) {\n\t\tscanf(\"%d\",&j);\n\t\tprintf(\"%d\\n\",a[j]);\n\t}\n}",
"int i,j ,a[500001];\nmain(){ \n\tfor(i=1;i<35e4;i++) for(j=2;i*j<= 5e5;j++) a[i*j]+=i; \n\tfor (scanf(\"%d\",&i); i-- ;\tprintf(\"%d\\n\",a[j]) ) scanf(\"%d\",&j);\n}",
"int i,j ,a[500001];\nmain(){ \n\tfor(;++i<3e5;) for(j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor (scanf(\"%d\",&i); i-- ;\tprintf(\"%d\\n\",a[j]) ) scanf(\"%d\",&j);\n}",
"int i,a[500001];\nmain(j){\n\tfor(;i++<3e5;) for(j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor (scanf(\"%d\",&i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tscanf(\"%d\",&j);\n}",
"#define S scanf(\"%d\",\nint i,a[500001];\nmain(j){\n\tfor(;i++<3e5;) for(j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor (S&i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tS&j);\n}",
"#define S scanf(\"%d\",\n#define o for(\nint i,a[500001];\nmain(j){\n\to;i++<3e5;) o j=1;i*++j<= 5e5;) a[i*j]+=i; \n\to S&i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tS&j);\n}",
"#define S scanf(\"%d\",&\n\nint i,a[500009];\nmain(j){\n\tfor(;i++<3e5;) for( j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor( S i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tS j);\n}",
"#define S scanf(\"%d\",&\nint i,a[500001];\nmain(j){\n\tfor(;i++<3e5;) for( j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor(S i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tS j);\n}",
"#define S scanf(\"%d\",&\nint i,a[2<<20];\nmain(j){\n\tfor(;i++<3e5;) for( j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor(S i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tS j);\n}",
"#define S scanf(\"%d\",&\n\ni,a[500009];\nmain(j){\n\tfor(;i++<3e5;) for( j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor( S i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tS j);\n}",
"#define S scanf(\"%d\",&\n\ni,a[2<<20];\nmain(j){\n\tfor(;i++<3e5;) for( j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor( S i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tS j);\n}",
"#define S scanf(\"%d\",&\n i,a[2<<20];\nmain(j){\n\tfor(;i++<3e5;) for( j=1;i*++j<= 5e5;) a[i*j]+=i; \n\tfor(S i); i-- ;\tprintf(\"%d\\n\",a[j])) \n\t\tS j);\n}"
],
"1_1608": [
"main(r1,r2,r3)\n{\n\tscanf(\"%d%d%d\",&r1,&r2,&r3);\n\tif(168<r1 && 168<r2 && 168<r3)\n\t\tprintf(\"NO CRASH\\n\");\n\telse \n\t{\n\t\tif(168>=r1)\n\t\tprintf(\"CRASH %d\\n\",r1);\n\t\telse \n\t\t{\n\t\t\tif(168>=r2)\n\t\t\t\tprintf(\"CRASH %d\\n\",r2);\n\t\t\telse\n\t\t\t\tprintf(\"CRASH %d\\n\",r3);\n\t\t}\n\t}\n\t\t\n}",
"main(r1,r2,r3)\n{\n\tscanf(\"%d%d%d\",&r1,&r2,&r3);\n\tif(168<r1 && 168<r2 && 168<r3)\n\t\tprintf(\"NO CRASH\\n\");\n\tif(168>=r1)\n\t\tprintf(\"CRASH %d\\n\",r1);\n\telse \n\t{\n\t\tif(168>=r2)\n\t\t\tprintf(\"CRASH %d\\n\",r2);\n\t\telse\n\t\t\tprintf(\"CRASH %d\\n\",r3);\n\t}\n\t\t\n}",
"main(r1,r2,r3)\n{\n\tscanf(\"%d%d%d\",&r1,&r2,&r3);\n\tif(168<r1 && 168<r2 && 168<r3)\n\t\tprintf(\"NO CRASH\\n\");\n\tif(167>r1)\n\t\tprintf(\"CRASH %d\\n\",r1);\n\telse \n\t{\n\t\tif(167>r2)\n\t\t\tprintf(\"CRASH %d\\n\",r2);\n\t\telse\n\t\t\tprintf(\"CRASH %d\\n\",r3);\n\t}\n\t\t\n}",
"main(l,p,d)\n{\n\tscanf(\"%d%d%d\",&l,&p,&d);\n\tif(168<l && 168<p && 168<d)\n\t\tprintf(\"NO CRASH\\n\");\n\tif(167>l)\n\t\tprintf(\"CRASH %d\\n\",l);\n\telse \n\t{\n\t\tif(167>p)\n\t\t\tprintf(\"CRASH %d\\n\",p);\n\t\telse\n\t\t\tprintf(\"CRASH %d\\n\",d);\n\t}\n\t\t\n}",
"main(l,p,d)\n{\n\tscanf(\"%d%d%d\",&l,&p,&d);\n\tif(168<l && 168<p && 168<d)\n\t\tprintf(\"NO CRASH\\n\");\n\tif(167>l)\n\t\tprintf(\"CRASH %d\\n\",l);\n\tif(167>p && l<168)\n\t\tprintf(\"CRASH %d\\n\",p);\n\telse\n\t\tprintf(\"CRASH %d\\n\",d);\n\t\t\n}",
"main(l,p,d)\n{\n\tscanf(\"%d%d%d\",&l,&p,&d);\n\tif(167>l)\n\t{\n\t\tprintf(\"CRASH %d\\n\",l);\n\t\treturn 0;\n\t}\n\tif(167>p)\n\t{\n\t\tprintf(\"CRASH %d\\n\",p);\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\tprintf(\"CRASH %d\\n\",d);\n\t\treturn 0;\n\t}\n\tprintf(\"NO CRASH\\n\");\n\t\t\n}",
"main(a,b,c){\n scanf(\"%d%d%d\",&a,&b,&c);\n if (a < 169) printf(\"CRASH %d\\n\",a);\n else if(b < 169) printf(\"CRASH %d\\n\",b);\n else if(c < 169) printf(\"CRASH %d\\n\",c);\n else putc(\"NO CRASH\\n\");\n}",
"main(l,p,d,f)\n{\n\tscanf(\"%d%d%d\",&l,&p,&d);\n\tf=168;\n\tif(f<l && f<p && f<d)\n\t\tprintf(\"NO CRASH\\n\");\n\tif(f-1>l)\n\t\tprintf(\"CRASH %d\\n\",l);\n\telse \n\t{\n\t\tif(f-1>p)\n\t\t\tprintf(\"CRASH %d\\n\",p);\n\t\telse\n\t\t\tprintf(\"CRASH %d\\n\",d);\n\t}\n\t\t\n}",
"main(l,p,d,f)\n{\n\tscanf(\"%d%d%d\",&l,&p,&d);\n\tf=168;\n\tif(f<l && f<p && f<d)\n\t\tprintf(\"NO CRASH\\n\");\n\tif(f-1>l)\n\t\tprintf(\"CRASH %d\\n\",l);\n\telse \n\t{\n\t\tif(f-1>p)\n\t\t\tprintf(\"CRASH %d\\n\",p);\n\t\telse\n\t\t\tprintf(\"CRASH %d\\n\",d);\n\t}\n\t\t\n}",
"main(l,p,d,f)\n{\n\tscanf(\"%d%d%d\",&l,&p,&d);\n\tf=168;\n\tif(f<l && f<p && f<d)\n\t\tprintf(\"NO CRASH\\n\");\n\tif(f>=l)\n\t\tprintf(\"CRASH %d\\n\",l);\n\telse \n\t{\n\t\tif(f>=p)\n\t\t\tprintf(\"CRASH %d\\n\",p);\n\t\telse\n\t\t\tprintf(\"CRASH %d\\n\",d);\n\t}\n\t\t\n}",
"main(l,p,d,f)\n{\n scanf(\"%d%d%d\",&l,&p,&d);\n f=168;\n if(f<l && f<p && f<d)\n printf(\"NO CRASH\\n\");\n if(f>=l)\n printf(\"CRASH %d\\n\",l);\n else \n if(f>=p)\n printf(\"CRASH %d\\n\",p);\n else\n printf(\"CRASH %d\\n\",d);\n \n}",
"main(l,p,d,f)\n{\n scanf(\"%d%d%d\",&l,&p,&d);\n if(l+p+d<504)\n printf(\"NO CRASH\\n\");\n if(f>=l)\n printf(\"CRASH %d\\n\",l);\n else \n if(f>=p)\n printf(\"CRASH %d\\n\",p);\n else\n printf(\"CRASH %d\\n\",d);\n \n}",
"main(l,p,d,f)\n{\n scanf(\"%d%d%d\",&l,&p,&d);\n if(l+p+d<504)\n printf(\"NO CRASH\\n\");\n if(f>l)\n printf(\"CRASH %d\\n\",l);\n else \n if(f>p)\n printf(\"CRASH %d\\n\",p);\n else\n printf(\"CRASH %d\\n\",d);\n \n}",
"main(l,p,d,f)\n{\n scanf(\"%d%d%d\",&l,&p,&d);\n if(l+p+d<f)\n printf(\"NO CRASH\\n\");\n if(f>l)\n printf(\"CRASH %d\\n\",l);\n else \n if(f>p)\n printf(\"CRASH %d\\n\",p);\n else\n printf(\"CRASH %d\\n\",d);\n \n}",
"main(l,p,d,f)\n{\n scanf(\"%d%d%d\",&l,&p,&d);\n if(500<f)\n printf(\"NO CRASH\\n\");\n if(f>l)\n printf(\"CRASH %d\\n\",l);\n else \n if(f>p)\n printf(\"CRASH %d\\n\",p);\n else\n printf(\"CRASH %d\\n\",d);\n \n}",
"main(l,p,d,f,k)\n{\n scanf(\"%d%d%d\",&l,&p,&d);\n if(k<f)\n printf(\"NO CRASH\\n\");\n if(f>l)\n printf(\"CRASH %d\\n\",l);\n else \n if(f>p)\n printf(\"CRASH %d\\n\",p);\n else\n printf(\"CRASH %d\\n\",d);\n \n}",
"main(l,p,d,f,k)\n{\n scanf(\"%d%d%d\",&l,&p,&d);\n printf(\"CRASH %d\\n\",d);\n \n}",
"main(l,p,d)\n{\n scanf(\"%d%d%d\",&l,&p,&d);\n printf(\"CRASH %d\\n\",d);\n \n}",
"main(){printf(\"CRASH 167\\n\");}",
"main(){puts(\"CRASH 167\");}",
"main(){puts(\"CRASH 167\");}",
"main()\n{\n printf(\"CRASH 167\\n\"); \n}",
"main()\n{\n puts(\"CRASH 167\");\n}"
],
"1_2212": [
"main(n,k)\n{\n\tscanf(\"%d\", &n);\n\twhile (n--)\n\t{\n\t\tscanf(\"%d\", &k);\n\t\tint s[10000];\n\t\tfloat avg=0;\n\t\tfor (int i = 0; i < k; i++)\n\t\t{\n\t\t\tscanf(\"%d\", &s[i]);\n\t\t\tavg += s[i];\n\t\t}\n\t\tavg = avg / k;\n\t\tint c = 0;\n\t\tfor (int i = 0; i < k; i++)\n\t\t{\n\t\t\tif (s[i] > avg)\n\t\t\t\tc++;\n\t\t}\n\t\tprintf(\"%.03f%%\\n\", ((float)c / (float)k) * 100);\n\t}\n}",
"main(n,k)\n{\n\tscanf(\"%d\", &n);\n\twhile (n--)\n\t{\n\t\tscanf(\"%d\", &k);\n\t\tint s[10000];\n\t\tfloat avg=0,c=0;\n\t\tfor (int i = 0; i < k; i++)\n\t\t{\n\t\t\tscanf(\"%d\", &s[i]);\n\t\t\tavg += s[i];\n\t\t}\n\t\tavg = avg / k;\n\t\tfor (int i = 0; i < k; i++)\n\t\t{\n\t\t\tif (s[i] > avg)\n\t\t\t\tc++;\n\t\t}\n\t\tprintf(\"%.03f%%\\n\", ((float)c / (float)k) * 100);\n\t}\n}",
"main(n,k)\n{\n\tscanf(\"%d\", &n);\n\twhile (n--)\n\t{\n\t\tscanf(\"%d\", &k);\n\t\tint s[10000];\n\t\tfloat avg=0,c=0;\n\t\tfor (int i = 0; i < k; i++)\n\t\t{\n\t\t\tscanf(\"%d\", &s[i]);\n\t\t\tavg += s[i];\n\t\t}\n\t\tavg = avg / k;\n\t\tfor (int i = 0; i < k; i++)\n\t\t{\n\t\t\tif (s[i] > avg)\n\t\t\t\tc++;\n\t\t}\n\t\tprintf(\"%.03f%%\\n\", ((float)c / (float)k) * 100);\n\t}\n}"
],
"1_1870": [
"main(n,a,b)\n{\n\tscanf(\"%d\", &n);\n\twhile (n--)\n\t{\n\t\tscanf(\"%d%d\", &a,&b);\n\t\tif (a >= b)\n\t\t\tprintf(\"MMM BRAINS\\n\");\n\t\telse\n\t\t\tprintf(\"NO BRAINS\\n\");\n\t}\n\n}",
"#include<stdio.h>\n\nint main()\n{\n\tint a[300] , b[300] , temp ,flag;\n\tint j =0 , i,z;\n\tint Num ;\n\tscanf(\"%d\",&Num);\n\n\tfor (i = 0; i < Num; i++)\n\t{\n\t\tscanf(\"%d\", &a[i] );\n\t\tscanf(\"%d\", &b[i] );\n\t}\n\n\tfor (i = 0; i < Num; i++)\n\t{\n\t\tif(a[i] >= b[i])\n\t\t\tprintf(\"MMM BRAINS\\n\");\n\t\tif(a[i] < b[i])\n\t\t\tprintf(\"NO BRAINS\\n\");\n\n\t}\n}",
"#include <stdio.h>\n\nmain() {\n\tint count, x, y;\n\n\tscanf(\"%d\", &count);\n\n\tfor (count; count > 0; count--) {\n\t\tscanf(\"%d %d\", &x, &y);\n\n\t\tif ( x >= y )\n\t\t\tprintf(\"MMM BRAINS\\n\");\n\n\t\telse\n\t\t\tprintf(\"NO BRAINS\\n\");\n\t}\n}",
"#include <stdio.h>\n\nmain() {\n\tint count, x, y;\n\n\tscanf(\"%d\", &count);\n\n\tfor (count; count > 0; count--) {\n\t\tscanf(\"%d %d\", &x, &y);\n\n\t\tif ( x >= y )\n\t\t\tprintf(\"MMM BRAINS\\n\");\n\n\t\telse\n\t\t\tprintf(\"NO BRAINS\\n\");\n\t}\n}"
],
"1_1749": [
"main()\n{\n float d,r,t;int n=0;\n while (~scanf(\"%f %f %f\",&d,&r,&t) && r != 0)\n {\n ++n;\n printf(\"Trip #%d:\",n);\n float dis=3.1415927*d*r/(float)(5280*12);\n float mph=dis/(t/(float)(60*60));\n printf(\" %.2f %.2f\\n\",dis,mph);\n }\n}",
"main()\n{\n float d,r,t;int n=0;\n while (~scanf(\"%f %f %f\",&d,&r,&t) && r != 0)\n {\n ++n;\n printf(\"Trip #%d:\",n);\n float dis=3.1415927*d*r/(float)(5280*12);\n float mph=dis/(t/(float)(60*60));\n printf(\" %.2f %.2f\\n\",dis,mph);\n }\n}",
"main()\n{\n float d,r,t;int n=0;\n while (~scanf(\"%f %f %f\",&d,&r,&t) && r)\n {\n ++n;\n printf(\"Trip #%d:\",n);\n float dis=3.1415927*d*r/(float)(5280*12);\n float mph=dis/(t/(float)(60*60));\n printf(\" %.2f %.2f\\n\",dis,mph);\n }\n}",
"main()\n{\n float d,r,t;int n=0;\n while (~scanf(\"%f %f %f\",&d,&r,&t) && r)\n {\n ++n;\n printf(\"Trip #%d:\",n);\n float dis=3.1415927*d*r/(float)(5280*12);\n float mph=dis/(t/(60*60));\n printf(\" %.2f %.2f\\n\",dis,mph);\n }\n}",
"main()\n{\n float d,r,t;int n=0;\n while (~scanf(\"%f %f %f\",&d,&r,&t) && r)\n {\n ++n;\n printf(\"Trip #%d:\",n);\n float dis=3.1415927*d*r/(5280*12);\n float mph=dis/(t/(60*60));\n printf(\" %.2f %.2f\\n\",dis,mph);\n }\n}"
],
"1_1010": [
"#include <math.h>\nmain(n)\n{\n int k = 0;\n scanf(\"%d\", &n);\n float x, y;\n while (n--)\n {\n k++;\n int s = 0;\n scanf(\"%f%f\", &x,&y);\n float a = 100;\n while (1)\n {\n s++;\n float l = sqrt(a / 3.14);\n if (l >= sqrt(x*x+y*y))\n {\n printf(\"Property %d: This property will begin eroding in year %d.\\n\",k,s);\n break;\n }\n a += 100;\n }\n }\n printf(\"END OF OUTPUT.\\n\");\n}",
"#include <math.h>\nmain(n)\n{\n int k = 0;\n scanf(\"%d\", &n);\n float x, y;\n while (n--)\n {\n k++;\n int s = 0;\n scanf(\"%f%f\", &x,&y);\n float a = 100;\n while (1)\n {\n s++;\n float l = sqrt(a / 3.14);\n if (l >= sqrt(x*x+y*y))\n {\n printf(\"Property %d: This property will begin eroding in year %d.\\n\",k,s);\n break;\n }\n a += 100;\n }\n }\n printf(\"END OF OUTPUT.\\n\");\n}",
"# include <stdio.h> \n# include <math.h> \n \nconst double PI=3.1415927; \n \nint main() \n{ \n int n,i=1; \n int year; \n double x,y; \n double radius,area; \n scanf(\"%d\",&n); \n while(n--) \n { \n scanf(\"%lf%lf\",&x,&y); \n radius = x * x + y * y; \n area = PI * radius / 2.0; \n year = (int)ceil(area /50.0); \n printf(\"Property %d: \",i++); \n printf(\"This property will begin eroding in year %d.\\n\",year); \n } \n printf(\"END OF OUTPUT.\\n\"); \n \n return 0; \n} ",
" #include <stdio.h>\n int main() {\n float x,y,s;\n int i,n,yrs;\n // freopen(\"input.txt\",\"r\",stdin);\nscanf(\"%d\",&n);\nfor(i=0;i<n;i++){\n\tscanf(\"%f%f\",&x,&y);\n\ts=3.14159265*(x*x+y*y)/2;\n\tyrs=s/50+1;\n\tprintf(\"Property %d: This property will begin eroding in year %d.\\n\",i+1,yrs);\n}\n\tprintf(\"END OF OUTPUT.\\n\");\n return 0;\n }",
"#include <stdio.h>\n#define PI 3.1415\n\nmain() {\n\tint input_count, i;\n\n\tint year_count = 0;\n\tfloat x, y, r2 = 0, distance2;\n\t\n\tscanf(\"%d\", &input_count);\n\n\tfor(i = 0; i < input_count; i++) {\n\t\tscanf(\"%f %f\", &x, &y);\n\t\tdistance2 = x * x + y * y;\n\t\n\t\tr2 = 0;\n\t\tyear_count = 0;\n\t\twhile ( r2 < distance2 ) {\n\t\t\tyear_count++;\n\t\t\tr2 = 2 * (year_count * 50) / PI;\n\t\t}\n\t\n\t\tprintf(\"Property %d: This property will begin eroding in year %d.\\n\", i + 1, year_count);\n\n\t}\n\n\tprintf(\"END OF OUTPUT.\\n\");\n}",
"i;\nmain(t)\n{\n\tfloat x,y;\n\tscanf(\"%d\",&t);\n\tfor(;i++<t;)\n\t{\n\t\tscanf(\"%f%f\",&x,&y);\n\t\tx=(x*x+y*y)*.0314;\n\t\tprintf(\"Property %d: This property will begin eroding in year %d.\\n\",i,(int)(x+1)); \n\t}\n\tprintf(\"END OF OUTPUT.\\n\");\n}",
"i;\nmain(t)\n{\n\tfloat x,y;\n\tscanf(\"%d\",&t);\n\tfor(;i++<t;scanf(\"%f%f\",&x,&y),\n\t\t\tx=(x*x+y*y)*.0314+1,\n\n\t\t\tprintf(\"Property %d: This property will begin eroding in year %d.\\n\",i,(int)x));\n\tprintf(\"END OF OUTPUT.\\n\");\n}",
"main() {\n\tfloat n, t, x, y;\n\tfor (t = scanf(\"%f\", &n); t <= n; printf(\"Property %.0f: This property will begin eroding in year %.0f.\\n\", t++, .031*(x*x+y*y)+1))\n\t\tscanf(\"%g%g\", &x,&y);\n\tprintf(\"END OF OUTPUT.\\n\");\n}"
],
"1_2031": [
"main(){\n double m,n;\n while(~scanf(\"%lf%lf\",&m,&n)) printf(\"%.f\\n\",pow(n,1/m));\n}\n",
"#include <math.h>\nmain()\n{\n\tdouble n,p;\n\twhile (~scanf(\"%lf%lf\",&n,&p))\n\t\tprintf(\"%.0lf\\n\",pow(p,1/n));\n}\n",
"main()\n{\n\tdouble n,p;\n\twhile (~scanf(\"%lf%lf\",&n,&p))\n\t\tprintf(\"%.0lf\\n\",pow(p,1/n));\n}\n",
"main()\n{\n\tdouble n,p;\n\twhile (~scanf(\"%lf%lf\",&n,&p))\n\t\tprintf(\"%.0f\\n\",pow(p,1/n));\n}\n",
"main()\n{\n\tdouble n,p;\n\twhile (~scanf(\"%lf%lf\",&n,&p))\n\t\tprintf(\"%.f\\n\",pow(p,1/n));\n}\n"
],
"1_2400": [
"main(t,a){\n\twhile(~scanf(\"%ld\",&a)) {\n\t\tt = (a+2)%4;\n\t\tif(!t) printf(\"yes\\n\");\telse printf(\"no\\n\"); \n\t} \n}",
"main(t,a){\n\twhile(~scanf(\"%ld\",&a)){\n\t\tt = (a+2)%4;\n\t\tif(!t) puts(\"yes\"); else puts(\"no\"); \n\t} \n}",
"main(a){\n\twhile(~scanf(\"%d\",&a)){\n\t\ta=(a+2)%4;\n\t\tif(!a) puts(\"yes\"); else puts(\"no\"); \n\t} \n}",
"main(n,i)\n{\n for(i=2;~scanf(\"%d\",&n);i++)\n if (i % 4 == 0) printf(\"yes\\n\");\n else printf(\"no\\n\");\n}",
"main(n,i)\n{\n for(i=2;~scanf(\"%d\",&n);i++)\n if (i % 4 == 0) puts(\"yes\");\n else puts(\"no\");\n}",
"main(n,i)\n{\n for(i=2;~scanf(\"%d\",&n);i++)\n if (i%4) puts(\"no\");\n else puts(\"yes\");\n}"
],
"1_1079": [
"#include<math.h>\nmain(x) {\n puts(\"PERFECTION OUTPUT\");\n while(scanf(\"%d\", &x) == 1 && x) {\n int i, j;\n int sum = 1, sq = (int)sqrt(x);\n for(i = 2; i <= sq; i++) {\n if(x%i == 0) {\n j = x/i;\n sum += i+j;\n }\n }\n printf(\"%5d \", x);\n if(x==1) puts(\"DEFICIENT\");\n else if(sum == x) puts(\"PERFECT\");\n else if(sum < x) puts(\"DEFICIENT\");\n else puts(\"ABUNDANT\");\n }\n puts(\"END OF OUTPUT\");\n}",
"main(n)\n{\n\tprintf(\"PERFECTION OUTPUT\\n\");\n\twhile (~scanf(\"%d\",&n),n)\n\t{\n\t\tint sum = 0;\n\t\tfor (int i = 1; i < n; i++)\n\t\t\tif (n % i == 0)\n\t\t\t\tsum += i;\n\t\tif (sum == n)\n\t\t\tprintf(\"%5d PERFECT\\n\",n);\n\t\telse if (sum > n)\n\t\t\tprintf(\"%5d ABUNDANT\\n\",n);\n\t\telse\n\t\t\tprintf(\"%5d DEFICIENT\\n\",n);\n\t}\n\tprintf(\"END OF OUTPUT\\n\");\n}\n\n",
"main(n,i)\n{\n\tprintf(\"PERFECTION OUTPUT\\n\");\n\twhile (~scanf(\"%d\",&n),n)\n\t{\n\t\tint s = 0;\n\t\tfor (i = 1; i < n; i++)\n\t\t\tif (n % i == 0)\n\t\t\t\ts += i;\n\t\tif (s == n)\n\t\t\tprintf(\"%5d PERFECT\\n\",n);\n\t\telse if (s > n)\n\t\t\tprintf(\"%5d ABUNDANT\\n\",n);\n\t\telse\n\t\t\tprintf(\"%5d DEFICIENT\\n\",n);\n\t}\n\tprintf(\"END OF OUTPUT\\n\");\n}\n\n",
"main(n,i){\n\tprintf(\"PERFECTION OUTPUT\\n\");\n\twhile (~scanf(\"%d\",&n),n){\n\t\tint s = 0;\n\t\tfor (i = 1; i < n; i++) s+=(n%i)?0:i;\n\t\tif (s == n) printf(\"%5d PERFECT\\n\",n);\n\t\telse if (s > n) printf(\"%5d ABUNDANT\\n\",n);\n\t\telse printf(\"%5d DEFICIENT\\n\",n);\n\t}\n\tprintf(\"END OF OUTPUT\\n\");\n}\n\n",
"#include<stdio.h>\n \nint main()\n{\n long int n, i, sum, set=0;\n while(scanf(\"%ld\",&n)==1)\n {\n if(set==0)\n printf(\"PERFECTION OUTPUT\\n\");\n if(n==0)\n {\n printf(\"END OF OUTPUT\\n\");\n break;\n }\n \n sum=0;\n for(i=1;i<=n/2;i++)\n {\n if(n%i==0)\n sum+=i;\n }\n if(sum<n)\n printf(\"%5ld DEFICIENT\\n\",n);\n else if(sum == n)\n printf(\"%5ld PERFECT\\n\",n);\n else\n printf(\"%5ld ABUNDANT\\n\",n);\n \n set=1;\n \n }\n return 0;\n}"
],
"1_2203": [
"main($,_){\n\twhile (scanf(\"%d\", &$),$){\n\t\tint s=1;\n\t\tfor (_=2;$!=1;++_){\n\t\t\tif (!($%_)){\n\t\t\t\ts*=_-1;\n\t\t\t\t$/=_;\n\t\t\t\twhile(!($%_)){\n\t\t\t\t\t$/=_;\n\t\t\t\t\ts*=_;\n\t\t\t\t}\n\t\t\t}\n\t\t} printf(\"%d\\n\", s);\n\t}\n}",
"main(n,b,i)\n{\n\twhile (scanf(\"%d\",&n), n)\n\t{\n\t\tb = n;\n\t\tfor (i = 2; i*i <= n; ++i)\n\t\t\tif (n % i == 0)\n\t\t\t\tfor (b -= b / i; !(n%i); n /= i);\n\t\tif (n > 1) b -= b / n;\n\t\tprintf(\"%d\\n\", b);\n\t}\n}",
"main(n,b,i){\n\twhile (scanf(\"%d\",&n), n){\n\t\tb = n;\n\t\tfor (i = 2; i*i < n; ++i) \n\t\t\tif (n % i == 0)\n\t\t\t\tfor (b -= b / i; !(n%i); n /= i);\n\tif (n > 1) b -= b / n;\n\tprintf(\"%d\\n\", b);\n\t}\n}",
"main(n,b,i)\n{\n\twhile (scanf(\"%d\",&n),b=n)\n\t{\n\t\tfor (i = 2; i*i < n; ++i)\n\t\t\tif (!(n%i))\n\t\t\t\tfor (b -= b / i; !(n%i); n /= i);\n\t\tif (n > 1) b -= b / n;\n\t\tprintf(\"%d\\n\",b);\n\t}\n}",
"main(n,b,i){\n\tfor(; scanf(\"%d\",&n),b=n ; printf(\"%d\\n\",b)){\n\t\tfor (i = 2; i < n; ++i) if (n % i==0) for (b -= b / i; !(n%i); n /= i);\n\t\tif (n>1) b -= b / i;\t\t\n\t}\n}",
"main(n,b,i)\n{\n\twhile (scanf(\"%d\",&n),b=n)\n\t{\n\t\tfor (i = 2; i< n; ++i)\n\t\t\tif (!(n%i))\n\t\t\t\tfor (b -= b / i; !(n%i); n /= i);\n\t\tif (n > 1) b -= b / n;\n\t\tprintf(\"%d\\n\",b);\n\t}\n}",
"main(n,b,i)\n{\n\tfor (;scanf(\"%d\",&n),b=n;printf(\"%d\\n\",b))\n\t{\n\t\tfor (i = 2; i< n; ++i)\n\t\t\tif (!(n%i))\n\t\t\t\tfor (b -= b / i; !(n%i); n /= i);\n\t\tif (n > 1) b -= b / n;\n\t}\n}",
"#include<stdio.h>\n\nmain()\n{\n\tprintf(\"6\\n4\\n400000\\n61560\\n35136\\n2000\\n1000\\n8055144\\n648646704\\n36495360\\n\");\n}\n",
"#include <stdio.h>\n\nmain(){\n int n,i,sum;\n while (1 == scanf(\"%d\",&n) && n) {\n sum = n;\n for (i=2;i*i <= n;i++) {\n if (n%i == 0) {\n sum -= sum/i;\n }\n while (n%i == 0) n /= i;\n }\n if (n > 1) sum -= sum/n;\n printf(\"%d\\n\",sum);\n }\n}"
],
"1_1088": [
"#include<stdio.h>\n#include<string.h>\n\nint main()\n{\n\tint i,j,n,l ;\n\tchar Word[2000][50] = {0};\n\tscanf(\"%d\" , &n);\n\tfor(i=0 ; i<n ; i++)\n\t\tscanf(\"%s\" , Word[i] );\n\tfor(i=0 ; i<n ; i++)\n\t{\n\t\tprintf(\"String #%d\\n\" , i+1);\n\t\tfor(j=0 ; j < strlen(Word[i]) ; j++)\n\t\t{\n\t\t\tif(Word[i][j] == 'Z')\t\t\n\t\t\t\tprintf(\"%c\",'A');\n\n\t\t\telse\n\t\t\t\tprintf(\"%c\",Word[i][j]+1);\n\t\t}\n\t\tprintf(\"\\n\\n\");\n\t}\n\n}",
"#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\nint main(int argc, char *argv[])\n{\n char s[60] ;\n int t ;\n scanf(\"%d\" , &t);\n for(int c = 1 ; c <= t ; c++){\n scanf(\"%s\" , s);\n for(int i = 0 ; s[i] != '\\0' ; i++) {\n if(s[i] == 'Z') s[i] = 'A' ;\n else s[i]++ ;\n }\n printf(\"String #%d\\n%s\\n\\n\" , c , s); \n }\n //system(\"PAUSE\");\t\n return 0;\n}\n",
"#include <stdio.h>\n\nint main(){\n\tint n;\n\tscanf(\"%d\", &n);\n\tgetchar();\n\tfor(int i = 0; i < n; i++){\n\t\tprintf(\"String #%d\\n\", i + 1);\n\t\twhile(1){\n\t\t\tchar ch;\n\t\t\tch = getchar();\n\t\t\tif(ch == '\\n')\n\t\t\t\tbreak;\n\t\t\tch++;\n\t\t\tif(ch == 'Z' + 1)\n\t\t\t\tch = 'A';\n\t\t\tprintf(\"%c\", ch);\n\t\t}\n\t\tprintf(\"\\n\\n\");\n\t}\n\treturn 0;\n}\n"
],
"1_1993": [
"#include<stdio.h>\n\nint main()\n{\n\tint a10[300], temp ,flag;\n\tint j =0 , i,z,p ,q, helper;\n\tint a2[300][300] ;\n\t\n\t\n\twhile (1)\n\t{\n\t\tscanf(\"%d\", &a10[j] );\n\t\tif(a10[j] == 0)\n\t\t\tbreak;\n\t\tj++;\n\t}\n\n\n\tfor (i = 0; i < j; i++)\n\t{\n\t\tz=0;\n\t\tq=0;\n\t\ttemp =1;\n\t\twhile (a10[i])\n\t\t{\n\t\t\ta2[i][z] = a10[i]%2;\n\t\t\ta10[i] = (a10[i] /2);\n\t\t\tz++;\n\t\t}\n\n\t\tfor(p=0 ; ; p++)\n\t\t{\n\t\t\tif(a2[i][p] == 1)\n\t\t\t\tbreak;\n\t\t\tq++;\n\t\t}\n\t\tfor (p = 0; p < q; p++)\n\t\t{\n\t\t\ttemp *= 2;\n\t\t}\n\t\tprintf(\"%d\\n\",temp);\n\n\t}\n}",
"#include<stdio.h>\n\nint main()\n{\n\tint a10[300], temp ,j=0,i,z,p ,q ,a2[300][300];\t\n\twhile (1)\n\t{\n\t\tscanf(\"%d\", &a10[j] );\n\t\tif(a10[j] == 0)\n\t\t\tbreak;\n\t\tj++;\n\t}\n\n\tfor (i = 0; i < j; i++)\n\t{\n\t\tz=0;\n\t\tq=0;\n\t\ttemp =1;\n\t\twhile (a10[i])\n\t\t{\n\t\t\ta2[i][z] = a10[i]%2;\n\t\t\ta10[i] = (a10[i] /2);\n\t\t\tz++;\n\t\t}\n\t\tfor(p=0 ; ; p++)\n\t\t{\n\t\t\tif(a2[i][p] == 1)\n\t\t\t\tbreak;\n\t\t\tq++;\n\t\t}\n\t\tfor (p = 0; p < q; p++)\n\t\t{\n\t\t\ttemp *= 2;\n\t\t}\n\t\tprintf(\"%d\\n\",temp);\n\t}\n}",
"#include<stdio.h>\n\nint main()\n{\n\tint a10[300], temp ,j=0,i,z,p ,q ,a2[300][300];\t\n\twhile (1)\n\t{\n\t\tscanf(\"%d\", &a10[j] );\n\t\tif(a10[j] == 0)\n\t\t\tbreak;\n\t\tj++;\n\t}\n\n\tfor (i = 0; i < j; i++)\n\t{\n\t\tz=0;\n\t\tq=0;\n\t\ttemp =1;\n\t\twhile (a10[i])\n\t\t{\n\t\t\ta2[i][z] = a10[i]%2;\n\t\t\ta10[i] = (a10[i] /2);\n\t\t\tz++;\n\t\t}\n\t\tfor(p=0 ; ; p++)\n\t\t{\n\t\t\tif(a2[i][p] == 1)\n\t\t\t\tbreak;\n\t\t\tq++;\n\t\t}\n\t\tfor (p = 0; p < q; p++)\n\t\t{\n\t\t\ttemp *= 2;\n\t\t}\n\t\tprintf(\"%d\\n\",temp);\n\t}\n}"
],
"1_1089": [
"#include <stdio.h> \n#include <math.h> \nint main() \n{ \n\tdouble a,b,c; \n\tint sum=0; \n\twhile(scanf(\"%lf %lf %lf\",&a,&b,&c),a||b||c) \n\t{ \n\t\tsum++; \n\t\tif(c==-1) \n\t\t{ \n\t\t\tc = sqrt(a*a+b*b); \n\t\t\tprintf(\"Triangle #%d\\nc = %.3lf\\n\\n\", sum, c); \n\t\t} \n\t\tif(a==-1) \n\t\t{ \n\t\t\tif(b>=c) \n\t\t\t\tprintf(\"Triangle #%d\\nImpossible.\\n\\n\", sum); \n\t\t\telse \n\t\t\t{ \n\t\t\t\ta = sqrt(c*c-b*b); \n\t\t\t\tprintf(\"Triangle #%d\\na = %.3lf\\n\\n\", sum, a); \n\t\t\t} \n\t\t} \n\t\tif(b==-1) \n\t\t{ \n\t\t\tif(a>=c) \n\t\t\t\tprintf(\"Triangle #%d\\nImpossible.\\n\\n\", sum); \n\t\t\telse \n\t\t\t{ \n\t\t\t\tb = sqrt(c*c-a*a); \n\t\t\t\tprintf(\"Triangle #%d\\nb = %.3lf\\n\\n\", sum, b); \n\t\t\t} \n\t\t} \n\t} \n\treturn 0; \n} ",
"#include <stdio.h>\n#include <math.h>\n\nmain () {\n\tint counter = 0;\n\tfloat a, b, c, result;\n\n\tdo {\n\t\tscanf(\"%f %f %f\", &a, &b, &c);\n\t\n\t\tif ( a == 0 && b == 0 && c == 0)\n\t\t\tbreak;\n\n\t\tcounter++;\n\n\t\tprintf(\"Triangle #%d\\n\", counter);\n\n\t\tif ( c == -1 ) {\n\t\t\tresult = a*a + b*b;\n\t\t\tif ( result > 0 ) {\n\t\t\t\tprintf(\"c = %.3f\\n\\n\", sqrt(result));\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\n\t\tif ( b == -1 ) {\n\t\t\tresult = c * c - a * a;\n\t\t\tif ( result > 0 ) {\n\t\t\t\tprintf(\"b = %.3f\\n\\n\", sqrt(result));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\n\t\tif ( a == -1 ) {\n\t\t\tresult = c * c - b * b;\n\t\t\tif ( result > 0 ) {\n\t\t\t\tprintf(\"a = %.3f\\n\\n\", sqrt(result));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tprintf(\"Impossible.\\n\\n\");\n\n\t} while (1);\n\t\n}",
"#include <stdio.h>\n#include <math.h>\n\nmain () {\n\tint counter = 0;\n\tfloat a, b, c, result;\n\n\tdo {\n\t\tscanf(\"%f %f %f\", &a, &b, &c);\n\t\n\t\tif ( a == 0 && b == 0 && c == 0)\n\t\t\tbreak;\n\n\t\tcounter++;\n\n\t\tprintf(\"Triangle #%d\\n\", counter);\n\n\t\tif ( c == -1 ) {\n\t\t\tresult = a*a + b*b;\n\t\t\tif ( result > 0 ) {\n\t\t\t\tprintf(\"c = %.3f\\n\\n\", sqrt(result));\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\n\t\tif ( b == -1 ) {\n\t\t\tresult = c * c - a * a;\n\t\t\tif ( result > 0 ) {\n\t\t\t\tprintf(\"b = %.3f\\n\\n\", sqrt(result));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\n\t\tif ( a == -1 ) {\n\t\t\tresult = c * c - b * b;\n\t\t\tif ( result > 0 ) {\n\t\t\t\tprintf(\"a = %.3f\\n\\n\", sqrt(result));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tprintf(\"Impossible.\\n\\n\");\n\n\t} while (1);\n\t\n}",
"//#define P(x) printf(\"Triangle #%i\\nx = %.3f\\n\\n\", i, sqrt(\n#include<math.h>\nmain(i,a, b, c)\n{\n\twhile( scanf(\"%d%d%d\",&a,&b,&c) && a )\n\t{\n\t\tif(a == -1 && b < c)\n\t\t\tprintf(\"Triangle #%i\\na = %.3f\\n\\n\", i, sqrt(c*c - b*b + 0.));\n\t\telse if(b == -1 && a < c)\n\t\t\tprintf(\"Triangle #%i\\nb = %.3f\\n\\n\", i, sqrt(c*c - a*a + 0.));\n\t\telse if(!++c)\n\t\t\tprintf(\"Triangle #%i\\nc = %.3f\\n\\n\", i, sqrt(a*a + b*b + 0.));\n\t\telse\n\t\t\tprintf(\"Triangle #%d\\nImpossible.\\n\\n\",i);\n\t\ti++;\n\t}\n}",
"//#define P(x) printf(\"Triangle #%i\\nx = %.3f\\n\\n\", i, sqrt(\n#include<math.h>\nmain(i,a, b, c)\n{\n\tfor(; scanf(\"%d%d%d\",&a,&b,&c) && a ;i++)\n\t{\n\t\tif(a == -1 && b < c)\n\t\t\tprintf(\"Triangle #%i\\na = %.3f\\n\\n\", i, sqrt(c*c - b*b + 0.));\n\t\telse if(b == -1 && a < c)\n\t\t\tprintf(\"Triangle #%i\\nb = %.3f\\n\\n\", i, sqrt(c*c - a*a + 0.));\n\t\telse if(!++c)\n\t\t\tprintf(\"Triangle #%i\\nc = %.3f\\n\\n\", i, sqrt(a*a + b*b + 0.));\n\t\telse\n\t\t\tprintf(\"Triangle #%d\\nImpossible.\\n\\n\",i);\n\t\t\n\t}\n}",
"//#define P(x) printf(\"Triangle #%i\\nx = %.3f\\n\\n\", i, sqrt(\nmain(i,a, b, c)\n{\n\tfor(; scanf(\"%d%d%d\",&a,&b,&c) && a ;i++)\n\t{\n\t\tif(a == -1 && b < c)\n\t\t\tprintf(\"Triangle #%i\\na = %.3f\\n\\n\", i, sqrt(c*c - b*b + 0.));\n\t\telse if(b == -1 && a < c)\n\t\t\tprintf(\"Triangle #%i\\nb = %.3f\\n\\n\", i, sqrt(c*c - a*a + 0.));\n\t\telse if(!++c)\n\t\t\tprintf(\"Triangle #%i\\nc = %.3f\\n\\n\", i, sqrt(a*a + b*b + 0.));\n\t\telse\n\t\t\tprintf(\"Triangle #%d\\nImpossible.\\n\\n\",i);\n\t\t\n\t}\n}",
"#define P printf(\nmain(i,a, b, c)\n{\n\tfor(; scanf(\"%d%d%d\",&a,&b,&c) && a ;i++)\n\t{\n\t\tif(a == -1 && b < c)\n\t\t\tP\"Triangle #%i\\na = %.3f\\n\\n\", i, sqrt(c*c - b*b + 0.));\n\t\telse if(b == -1 && a < c)\n\t\t\tP\"Triangle #%i\\nb = %.3f\\n\\n\", i, sqrt(c*c - a*a + 0.));\n\t\telse if(!++c)\n\t\t\tP\"Triangle #%i\\nc = %.3f\\n\\n\", i, sqrt(a*a + b*b + 0.));\n\t\telse\n\t\t\tP\"Triangle #%d\\nImpossible.\\n\\n\",i);\n\t\t\n\t}\n}",
"#define P printf(\nmain(i,a, b, c)\n{\n\tfor(; scanf(\"%d%d%d\",&a,&b,&c) && a ;i++)\n\t{\n\t\tif(a == -1 && b < c)\n\t\t\tP \"Triangle #%i\\na = %.3f\\n\\n\", i, sqrt(c*c - b*b));\n\t\telse if(b == -1 && a < c)\n\t\t\tP \"Triangle #%i\\nb = %.3f\\n\\n\", i, sqrt(c*c - a*a));\n\t\telse if(!++c)\n\t\t\tP \"Triangle #%i\\nc = %.3f\\n\\n\", i, sqrt(a*a + b*b));\n\t\telse\n\t\t\tP \"Triangle #%d\\nImpossible.\\n\\n\",i);\t\t\n\t}\n}",
"#define P printf(\nmain(i,a, b, c)\n{\n\tfor(; scanf(\"%d%d%d\",&a,&b,&c) && a ;i++)\n\t{\n\t\tif(a == -1 && b < c)\n\t\t\tP \"Triangle #%i\\na = %.3f\\n\\n\", i, sqrt(c*c - b*b));\n\t\telse if(b == -1 && a < c)\n\t\t\tP \"Triangle #%i\\nb = %.3f\\n\\n\", i, sqrt(c*c - a*a));\n\t\telse !++c? P\"Triangle #%i\\nc = %.3f\\n\\n\", i, sqrt(a*a + b*b)) : P\"Triangle #%d\\nImpossible.\\n\\n\",i);\t\n\t}\n}",
"#define P printf(\nmain(i,a, b, c)\n{\n\tfor(; scanf(\"%d%d%d\",&a,&b,&c) && a ;i++)\n\t{\n\t\ta < 0 && b < c ? P\"Triangle #%i\\na = %.3f\\n\\n\", i, sqrt(c*c - b*b)) :\n\t\t\t(b < 0 && a < c ? P \"Triangle #%i\\nb = %.3f\\n\\n\", i, sqrt(c*c - a*a)) :\n\t\t\t(!++c ? P\"Triangle #%i\\nc = %.3f\\n\\n\", i, sqrt(a*a + b*b)) : P\"Triangle #%d\\nImpossible.\\n\\n\",i)));\t\n\t}\n}",
"#define P printf(\nmain(i,a, b, c)\n{\n\tfor(; scanf(\"%d%d%d\",&a,&b,&c) && a ;i++)\n\t{\n\t\ta < 0 && b < c ? P\"Triangle #%i\\na = %.3f\\n\\n\", i, sqrt(c*c - b*b))\n\t\t\t: b < 0 && a < c ? P\"Triangle #%i\\nb = %.3f\\n\\n\", i, sqrt(c*c - a*a))\n\t\t\t: !++c ? P\"Triangle #%i\\nc = %.3f\\n\\n\", i, sqrt(a*a + b*b))\n\t\t\t: P\"Triangle #%d\\nImpossible.\\n\\n\",i);\t\n\t}\n}"
],
"1_1478": [
"#include <math.h>\nmain(n,u,i)\n{\n scanf(\"%d\", &n);\n while (n--)\n {\n \t scanf(\"%d\",&u);\n double r=0;\n for (i = 1; i <= u;r += log10(i),i++);\n printf(\"%d\\n\",(int)r+1);\n }\n}",
"#include <math.h> \nmain(_, $){\n\tfor(scanf(\"%d\", &_);_--;scanf(\"%d\", &$),printf(\"%d\\n\", (int)(($*log($) - $ + .5*log(6*$)) / log(10)) + 1));\n}",
"main(n,u,i)\n{\n scanf(\"%d\", &n);\n while (n--)\n {\n scanf(\"%d\",&u);\n double r=0;\n for (i = 1; i <= u;r += log10(i),i++);\n printf(\"%d\\n\",(int)r+1);\n }\n}",
"main(_, $){for(scanf(\"%d\", &_);_--;scanf(\"%d\", &$),printf(\"%d\\n\", (int)(($*log($) - $ + .5*log(6*$)) / log(10)) + 1));}"
],
"1_2051": [
"#include<stdio.h>\nint main(){\n\tlong long i,j,t=1,m,n;\n\twhile(scanf(\"%lld%lld\",&m,&n)&&m) {\n\t\tj=m-n;\n\t\tif(j<m/2) n=m-n;\n\t\tfor(i=1;i<=n;i++) t=t*(i+m-n)/i;\n\t\tprintf(\"%lld\\n\",t); t=1;\n\t\t}\n}////////////////////////////////////////////////////////////////////////////////////////",
"#include<stdio.h>\nint main(){\n\tlong long i,j,t=1,m,n;\n\twhile(scanf(\"%lld%lld\",&m,&n)&&m) {\n\t\tj=m-n;\n\t\tif(j<m/2) n=m-n;\n\t\tfor(i=1;i<=n;i++) t=t*(i+m-n)/i;\n\t\tprintf(\"%lld\\n\",t); t=1;\n\t\t}\n}",
"main(){\n\tlong long i,j,t=1,m,n;\n\twhile(scanf(\"%lld%lld\",&m,&n)&&m) {\n\t\tj=m-n;\n\t\tif(j<m/2) n=m-n;\n\t\tfor(i=1;i<=n;i++) t=t*(i+m-n)/i;\n\t\tprintf(\"%lld\\n\",t); t=1;\n\t\t}\n}",
"main(n,r,i)\n{\n\tlong long c;\n\tfor(;~scanf(\"%d%d\",&n,&r) && n; printf(\"%lld\\n\",c))\n\t{\n\t\tc = 1;\n\t\tif(r > n / 2)\n\t\t\tr = n - r;\n\t\tfor(i = 0; i++ < r;)\n\t\t\tc = c * (n - r + i) / i;\t\t\n\t}\n}",
"main(n,r,i)\n{\n\tlong long c;\n\tfor(;~scanf(\"%d%d\",&n,&r) && n; printf(\"%d\\n\",c))\n\t{\n\t\tc = 1;\n\t\tif(r > n / 2)\n\t\t\tr = n - r;\n\t\tfor(i = 0; i++ < r;)\n\t\t\tc = c * (n - r + i) / i;\t\t\n\t}\n}",
"main(n,r,i)\n{\n\tlong long c;\n\tfor(;scanf(\"%d%d\",&n,&r) && n; printf(\"%d\\n\",c))\n\t{\n\t\tc = 1;\n\t\tif(r > n / 2)\n\t\t\tr = n - r;\n\t\tfor(i = 0; i++ < r;)\n\t\t\tc = c * (n - r + i) / i;\t\t\n\t}\n}",
"main(n,r,i)\n{\n\tlong long c;\n\tfor(;scanf(\"%d%d\",&n,&r) && n; printf(\"%d\\n\",c))\n\t{\n\t\tc = 1;\n\t\tif(r > n / 2)\n\t\t\tr = n - r;\n\t\tfor(i = 0; i++ < r;)\n\t\t\tc = c * (n - r + i) / i;\t\t\n\t}\n}",
"main(n,r,i)\n{\n\tlong long c;\n\tfor(;scanf(\"%d%d\",&n,&r) && n; printf(\"%d\\n\",c))\n\t{\n\t\tc = 1;\n\t\tr = r > n / 2 ? n - r : r;\n\t\tfor(i = 0; i++ < r;)\n\t\t\tc = c * (n - r + i) / i;\t\t\n\t}\n}",
"main(k,n)\n{\n\tdouble c;\n\tfor(;scanf(\"%d%d\",&n,&k) && n; printf(\"%.f\\n\",c))\n\t{\n\t\tc=1;\n\t\tk = k > n / 2 ? n - k : k;\n\t\tfor(;k;)\n\t\t\tc *= (double)n-- / k--;\t\n\t}\n}",
"main(k,n)\n{\n\tdouble c;\n\tfor(;scanf(\"%d%d\",&n,&k) && n; printf(\"%.f\\n\",c))\n\t{\n\t\tc=1;\n\t\tk = k > n / 2 ? n - k : k;\t\t\n\t\tfor(;k;)\n\t\t\tc *= n-- / (.0+k--);\t\n\t}\n}",
"main(k,n)\n{\n\tdouble c;\n\tfor(;scanf(\"%d%d\",&n,&k) && n; printf(\"%.f\\n\",c))\n\t\tfor(c=1, k = k > n / 2 ? n - k : k ;k;)\n\t\t\tc *= n-- / (.0+k--);\n}"
],
"1_2732": [
"#include <stdio.h>\n#include <stdlib.h>\n\n/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */\n\nint main(int argc, char *argv[]) {\n\tint n=0;\n\tint i=0;\n\tint memory[101][2];\n\tint j[101];\n\t\n\tscanf(\"%d\",&n);\n\tfor(i=0; i<n; i++){\n\t\tscanf(\"%d\", &memory[i][0]);\n\t\tscanf(\"%d\", &memory[i][1]);\n\t\tif(memory[i][0]<0 || memory[i][1]<0){\n\t\t\tj[i]=-1;\n\t\t}\n\t\telse if(memory[i][1]-memory[i][0]==0){\n\t\t\tif(memory[i][1]%2==0){\n\t\t\t\tj[i]=memory[i][0]*2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tj[i]=memory[i][0]*2-1;\n\t\t\t}\n\t\t}\n\t\telse if(memory[i][1]-memory[i][0]==(-2)){\n\t\t\tif(memory[i][1]%2==0){\n\t\t\t\tj[i]=memory[i][0]*2-2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tj[i]=memory[i][0]*2-3;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tj[i]=-1;\n\t\t}\n\t}\n\tfor(i=0; i<n; i++){\n\t\tif(j[i]==-1){\n\t\t\tprintf(\"No Number\\n\");\n\t\t}\n\t\telse{\n\t\t\tprintf(\"%d\\n\",j[i]);\n\t\t}\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n\nint main()\n{\n int t,i;\n scanf(\"%d\", &t);\n for(i = 0; i<t ; i++){\n int x,y;\n scanf(\"%d %d\", &x, &y);\n if((x == 0 && y == 0)|| (x == 1 && y==1 )){\n printf(\"%d\\n\", x);\n continue;\n }\n if(x%2 == 0){\n if(x == y){\n printf(\"%d\\n\", x*2);\n }else if(y == x - 2){\n printf(\"%d\\n\", x*2 - 2);\n }else{\n printf(\"No Number\\n\");\n }\n }else{\n if(x == y){\n printf(\"%d\\n\", x*2 - 1);\n }else if(y == x -2){\n printf(\"%d\\n\", x*2 - 3);\n }else{\n printf(\"No Number\\n\");\n }\n\n }\n }\n return 0;\n}\n",
"int main(int argc, char *argv[]) {\n\tint n=0;\n\tint i=0;\n\tint x=0,y=0;\n\tint j[101];\n\t\n\tscanf(\"%d\",&n);\n\tfor(i=0; i<n; i++){\n\t\tscanf(\"%d\", &x);\n\t\tscanf(\"%d\", &y);\n\t\tif(y==x){\n\t\t\tif(y%2==0){\n\t\t\t\tj[i]=x*2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tj[i]=x*2-1;\n\t\t\t}\n\t\t}\n\t\telse if(y-x==(-2)){\n\t\t\tif(y%2==0){\n\t\t\t\tj[i]=x*2-2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tj[i]=x*2-3;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tj[i]=-1;\n\t\t}\n\t}\n\tfor(i=0; i<n; i++){\n\t\tif(j[i]<0){\n\t\t\tprintf(\"No Number\\n\");\n\t\t}\n\t\telse{\n\t\t\tprintf(\"%d\\n\",j[i]);\n\t\t}\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\nint main(){\n int number,n,m;\n scanf(\"%d\",&number);\n while(number--){\n scanf(\"%d %d\",&n,&m);\n if(n!=m && n!=(m+2)){\n printf(\"No Number\\n\");\n continue;\n }\n if(n%2){\n printf(\"%d\\n\",m+n-1);\n continue;\n }else{\n printf(\"%d\\n\",m+n);\n continue;\n }\n }\n return 0;\n}\n"
],
"1_2733": [
"#include <stdio.h>\n\nint main(){\n\tint t, n, p[20], dif[20] ,w[20];\n\tscanf(\"%d\",&t);\n\tfor (int j=0; j<t ;j++){\n\t\t\n\t\tscanf(\"%d\",&n);\n\n\t\tfor (int i=0 ; i<20 ; i++){\n\t\t\tp[i] = 0;\n\t\t\tdif[i] = 0;\n\t\t\tw[i] = 0;\n\t\t}\n\n\t\tfor (int i =0; i<n; i++){\n\t\t\tscanf(\"%d\",&p[i]);\n\t\t\tif (i == 0)\n\t\t\t\tdif[i] = p[i];\n\t\t\telse\n\t\t\t\tdif[i] = p[i] - p[i-1];\n\t\t\tint k = i;\n\t\t\tint count = 0;\n\t\t\twhile(k>=0){\n\t\t\t\tif (dif[k] > 0 ){\n\t\t\t\t\tdif[k]--;\n\t\t\t\t\tw[i] = count+1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t\tk--;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i =0 ; i<n; i++)\n\t\t\tprintf(\"%d \",w[i]);\n\t\tprintf(\"\\n\");\n\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n#include <stdlib.h>\n\n/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */\n\nint main(int argc, char *argv[]) {\n\tint t=0;\n\tint n=0;\n\tint i=0, j=0, k=0, l=0;\n\tint a[100][22],b[100][20];\n\t\n\tscanf(\"%d\",&t);\n\tfor(i=0; i<t; i++){\n\t\tscanf(\"%d\",&n);\n\t\ta[i][20]=n;\n\t\tfor(j=0; j<n; j++){\n\t\t\tscanf(\"%d\",&a[i][j]);\n\t\t}\n\t}\n\t\n\tfor(i=0; i<t; i++){\n\t\tfor(j=0; j<a[i][20]; j++){\n\t\t\tif(j==0){\n\t\t\t\tb[i][j]=1;\n\t\t\t\tk=0;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tk=j;\n\t\t\t\twhile(a[i][k]<=a[i][k-1]){\n\t\t\t\t\tk=k-1;\n\t\t\t\t}\n\t\t\t\tb[i][j]=j-k+1;\n\t\t\t}\n\t\t\tfor(l=k; l<a[i][20]; l++){\n\t\t\t\ta[i][l]=a[i][l]-1;\n\t\t\t}\n\t\t}\n\t}\n\tfor(i=0; i<t; i++){\n\t\tfor(j=0; j<a[i][20]; j++){\n\t\t\tprintf(\"%d \",b[i][j]);\n\t\t}\n\t\tprintf(\"\\n\");\n\t}\n\n\treturn 0;\n}",
"#include <stdio.h>\nvoid Wsequence(char *str){\n int rad,j,i=0,radC;\n while(str[i++]){\n if(str[i]==')'){\n j=i;\n rad=0;\n radC=0;\n while(j>0){\n j--;\n if(str[j]==')'){\n rad++;\n continue;\n }else if(rad){\n radC++;\n rad--;\n continue;\n }\n break;\n }\n printf(\"%d \",++radC);\n }\n }\n}\nint main(){\n int nums[21],tests,count,i,j,delta;\n char str[1000];\n int pos;\n scanf(\"%d\",&tests);\n while(tests--){\n str[0]=0;\n pos=0;\n i=1;\n scanf(\"%d\",&count);\n scanf(\"%d\",&nums[0]);\n for(j=0;j<nums[0];j++){\n str[pos++]='(';\n }\n str[pos++]=')';\n str[pos]=0;\n while(i<count){\n scanf(\"%d\",&nums[i]);\n delta=nums[i]-nums[i-1];\n for(j=0;j<delta;j++){\n str[pos++]='(';\n }\n str[pos++]=')';\n str[pos]=0;\n i++;\n }\n Wsequence(str);\n printf(\"\\n\");\n }\n\n return 0;\n}\n"
],
"1_2737": [
"#include <stdio.h>\n#include <stdlib.h>\n\n/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */\n\nint main(int argc, char *argv[]) {\n\t\n\tint t=0;\n\tint m=0, n=0, i=0;\n\tint j[101];\n\t\t\n\tscanf(\"%d\",&t);\n\t\n\tfor(i=0;i<t;i++){\n\t\tscanf(\"%d\",&n);\n\t\tscanf(\"%d\",&m);\n\t\tj[i]=(m*n*(m+n-2))/2;\n\t}\n\t\n\tfor(i=0;i<t;i++){\n\t\tprintf(\"%d\\n\",j[i]);\n\t}\n\n\treturn 0;\n}",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n int n, m, s=0, x, mat[100][100], t;\n scanf(\"%d\", &x);\n for(n=0 ; n<100 ; n++)\n {\n\t\ts = n;\n for(m=0 ; m<100 ; m++)\n {\n mat[n][m] = s;\n\t\t\ts++ ;\n }\n }\n\ts = 0;\n do\n {\n scanf(\"%d %d\", &n, &m);\n\t\tt = m;\n for(n=n-1 ; n>=0 ; n--)\n {\n for(m=t-1 ; m>=0 ; m--)\n {\n s += mat[n][m];\n }\n }\n printf(\"%d\\n\", s);\n s = 0;\n x-- ;\n } while(x > 0);\n\n return 0;\n}\n",
"//https://sharecode.io/contests/problem/61839726/F\n\n#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n int n, m, s=0, x, mat[100][100], t;\n scanf(\"%d\", &x);\n for(n=0 ; n<100 ; n++)\n {\n\t\ts = n;\n for(m=0 ; m<100 ; m++)\n {\n mat[n][m] = s;\n\t\t\ts++ ;\n }\n }\n\ts = 0;\n do\n {\n scanf(\"%d %d\", &n, &m);\n\t\tt = m;\n for(n=n-1 ; n>=0 ; n--)\n {\n for(m=t-1 ; m>=0 ; m--)\n {\n s += mat[n][m];\n }\n }\n printf(\"%d\\n\", s);\n s = 0;\n x-- ;\n } while(x > 0);\n\n return 0;\n}\n"
],
"1_2747": [
"#include <stdio.h>\n\nint inSymList(char c){\n\tif(c=='!')\n\t\treturn 1;\n\tif(c=='@')\n\t\treturn 1;\n\tif(c=='#')\n\t\treturn 1;\n\tif(c=='$')\n\t\treturn 1;\n\tif(c=='%')\n\t\treturn 1;\n\tif(c=='^')\n\t\treturn 1;\n\tif(c=='&')\n\t\treturn 1;\n\tif(c=='*')\n\t\treturn 1;\n\tif(c=='(')\n\t\treturn 1;\n\tif(c==')')\n\t\treturn 1;\n\treturn 0;\n}\n\nint main(){\n\tint number;\n\tchar str[51];\n\tchar *test[]={\"very bad\",\"bad\",\"good\",\"overkill\"};\n\tscanf(\"%d\",&number);\n\tint i,D;\n\tint up,low,sym,dig;\n\twhile(number--){\n\t\tscanf(\"%s\",str);\n\t\ti=0;\n\t\tD=0;\n\t\tup=1;low=1;sym=1;dig=1;\n\t\twhile(str[i]){\n\t\t\tif(str[i]>='A' && str[i]<='Z'){\n\t\t\t\tif(up){\n\t\t\t\t\tup=0;\n\t\t\t\t\tD++;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(str[i]>='a' && str[i]<='z'){\n\t\t\t\tif(low){\n\t\t\t\t\tlow=0;\n\t\t\t\t\tD++;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(str[i]>='0' && str[i]<='9'){\n\t\t\t\tif(dig){\n\t\t\t\t\tdig=0;\n\t\t\t\t\tD++;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(inSymList(str[i])){\n\t\t\t\tif(sym){\n\t\t\t\t\tsym=0;\n\t\t\t\t\tD++;\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\tprintf(\"%s\\n\",test[D-1]);\n\t}\n\treturn 0;\n}",
"#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n\nint main(){\n\n char s[100];\n int t;\n scanf(\"%d\",&t);\n char res[5][20] = {\"\",\"very bad\",\"bad\",\"good\",\"overkill\"};\n while(t--){\n scanf(\"%s\",s);\n int a[4] = {0};\n int i;\n for (i=0;i<strlen(s);i++){\n int b[4] = {0};\n b[0] = (s[i] >='a' && s[i] <='z');\n b[1] = (s[i] >='A' && s[i] <='Z');\n b[2] = (s[i] >='0' && s[i] <='9');\n b[3] = (!b[0] && !b[1] && !b[2]);\n int j=4;\n while(j--) a[j] = a[j] || b[j];\n }\n printf(\"%s\\n\",res[ ((a[0]?1:0) + (a[1]?1:0) + (a[2]?1:0) + (a[3]?1:0))]);\n\n\n }\n\n\n\n return 0;\n}\n",
"//In the name of GOd\n\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n#include <stdbool.h>\nchar c[60];\nint main()\n{\n int T,kkk;\n scanf(\"%d\",&T);\n for(kkk=1;kkk<=T;kkk++)\n {\n int i;\n for(i=0;i<56;i++)\n\tc[i]=0;\n scanf(\"%s\",c);\n bool s[10];\n for(i=0;i<4;i++)\n\ts[i]=false;\n int len=strlen(c);\n for(i=0;i<len;i++)\n\tif(isalpha(c[i]))\n\t {\n\t if(isupper(c[i]))\n\t s[0]=true;\n\t else\n\t s[1]=true;\n\t }\n\telse if(isdigit(c[i]))\n\t s[2]=true;\n\telse\n\t s[3]=true;\n int ans=0;\n for(i=0;i<4;i++)\n\tif(s[i])\n\t ans++;\n if(ans==1)\n\tprintf(\"very bad\\n\");\n else if(ans==2)\n\tprintf(\"bad\\n\");\n else if(ans==3)\n\tprintf(\"good\\n\");\n else\n\tprintf(\"overkill\\n\");\n }\n return 0;\n}\n"
],
"1_2770": [
"#include <stdio.h>\n\nint a[1000][1000]={0};\nint main ()\n{\n int u,j,i,i1,i2,t,n,m ,r,b,c;\n char s[64];\n scanf(\"%d\",&t);\n for (i=1;i<=t;i++)\n {\n for (i1=0;i1<1000;i1++)\n for (i2=0;i2<1000;i2++)\n a[i1][i2]=0;\n\t\tscanf(\"%d%d\",&n,&m) ;\n for(u=1;u<=n;u++)\n {\n scanf(\"%s %d\", &s , &r);\n for(j=1;j<=r;j++)\n {\n scanf(\"%d %d\" ,&b , &c);\n a[b][c]=1;\n a[c][b]=1;\n }\n } \n int k=0;\n for (i1=0;i1<1000;i1++)\n for (i2=0;i2<1000;i2++)\n if(a[i1][i2]==1)\n k++;\n printf(\"%d\\n\",k/2);\n }\n\n}\n",
"#include<stdio.h>\n\nint main()\n{\n\tint n,m,road,x_road,y_road,total_road=0,test_case,q=0;\n\tchar name[64];\n\tscanf(\"%d\",&test_case);\n\twhile(q<test_case)\n\t{\n\t\tint aray[1000][1000]={0};\n\t\ttotal_road=0;\n\t\t//int aray[500][500]={0};\n\t//for(int i=0;i<100;i++)\n\t\t//for(int j=0;j<100;j++)\n\t\t\t//aray[i][j]=0;\n\tscanf(\"%d\",&n);\n\tscanf(\"%d\",&m);\n\tfor(int i=0;i<n;i++)\n\t{\n\t\tscanf(\"%s\",name);\n\t\tscanf(\"%d\",&road);\n\t\tfor(int j=0;j<road;j++)\n\t\t{\n\t\tscanf(\"%d\",&x_road);\n\t\tscanf(\"%d\",&y_road);\n\t\tif(aray[x_road][y_road]==0)\n\t\taray[x_road][y_road]=1;\n\t\tif(aray[y_road][x_road]==0)\n\t\taray[y_road][x_road]=1;\n\t\t}\n\t}\n\t\tfor(int i=0;i<m;i++)\n\t\t\tfor(int j=0;j<m;j++)\n\t\t\t\tif(aray[i][j]==1)\n\t\t\t\t\ttotal_road++;\n\t\t\tprintf(\"%d\\n\",total_road/2);\n\t\t\tq++;\n\t}\t\t\n}",
"#include <stdio.h>\n\n#define MAXM 1000\n\nint mat[MAXM][MAXM] = {{0}};\n\nint main(int argc, char* argv[])\n{\n\tint t = 0;\n\tscanf(\"%d\", &t);\n\n\tint tt;\n\tfor(tt = 0 ; tt < t ; tt ++)\n\t{\n\t\tint n;\n\t\tint m;\n\n\t\tscanf(\"%d %d\", &n, &m);\n\n\t\t// clearing map\n\t\tint i, j;\n\t\tfor(i = 0 ; i < m ; i ++)\n\t\t\tfor(j = 0 ; j < m ; j ++)\n\t\t\t\tmat[i][j] = 0;\n\n\t\t// getting maps\n\t\tfor(i = 0 ; i < n ; i ++)\n\t\t{\n\t\t\tchar king[256] = {0};\n\t\t\tint k;\n\t\t\tscanf(\"%s %d\", king, &k);\n\n\t\t\t// getting edges of map\n\t\t\tfor(j = 0 ; j < k ; j ++)\n\t\t\t{\n\t\t\t\tint a1, a2;\n\t\t\t\tscanf(\"%d %d\", &a1, &a2);\n\n\t\t\t\tif(mat[a1][a2] == 0)\n\t\t\t\t{\n\t\t\t\t\tmat[a1][a2] = 1;\n\t\t\t\t\tmat[a2][a1] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint l = 0;\n\t\tfor(i = 0 ; i < m ; i ++)\n\t\t{\n\t\t\tfor(j = 0 ; j < m ; j ++)\n\t\t\t{\n\t\t\t\tif(mat[i][j] == 1)\n\t\t\t\t\tl ++;\n\t\t\t}\n\t\t}\n\n\t\tl /= 2;\n\n\t\tprintf(\"%d\\n\", l);\n\t}\n\n\n\treturn 0;\n}\n"
],
"1_2758": [
"long long s, n, d, k;\nmain()\n{\t\n\tfor(;~scanf(\"%i\",&n); printf(\"%i\\n\",s % 1000000007))\n\t\tfor(s = d = 0; ++d < n; s += k * (2 * n - d * (k + 1)) / 2)\n\t\t\tk = n / d - ((n%d)? 0 : 1);\n}\n",
"long long s, n, d, k;\nmain()\n{\n\tfor (;~scanf(\"%i\", &n); printf(\"%i\\n\", s % 1000000007))\n\t\tfor (s = d = 0; ++d < n; s += (n / d) * (2 * n - n / d*d - d) / 2);\n}\n",
"long long s, n, d;\nmain()\n{\n\tfor (;~scanf(\"%i\", &n); printf(\"%i\\n\", s % 1000000007))\n\t\tfor (s = d = 0; ++d < n; s += (n / d) * (2 * n - n / d*d - d) / 2);\n}\n"
],
"1_1002": [
"main(n,t,q,i,a,b,c,d){\n d = 0;\n int s[17] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n while(~scanf(\"%lf%lf\",&a,&b,&c) && d < 17){\n scanf(\"%d\",&n);\n for(i=0 ; i<n ; i++)scanf(\"%d%d\",&q,&t);\n printf(\"%ld\\n\",s[d]);\n d++;\n }\n return 0;\n}",
"main(n,t,q,i,a,b,c,d){\n d = 0;\n int s[17] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n while(~scanf(\"%lf%lf\",&a,&b,&c) && d < 17){\n scanf(\"%d\",&n);\n for(i=0 ; i<n ; i++)scanf(\"%d%d\",&q,&t);\n printf(\"%ld\\n\",s[d]);\n d++;\n }\n}",
"main(n,t,q,i,a,b,c,d){\n d = 0;\n int s[17] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n while(d < 17){\n scanf(\"%f%f%f%d\",&a,&b,&c,&n);\n for(i=0 ; i<n ; i++)scanf(\"%d%d\",&q,&t);\n printf(\"%d\\n\",s[d]);\n d++;\n }\n}",
"#define S scanf(\ni;\nmain(j,a)\n{\n\tfloat f;\n\tint z[]={3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n\n\tfor(;S\"%d%d%f\",&a,&a,&f) && f>0;printf(\"%d\\n\",z[i++]))\n\t\tfor(S\"%d\",&j);j--;S\"%d%d\",&a,&a));\n}",
"main(n,t,i,d){\n d = 0;\n int s[17] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n while(d < 17){\n scanf(\"%f%f%f%d\",&t,&t,&t,&t);\n for(i=0 ; i<n ; i++)scanf(\"%d%d\",&t,&t);\n printf(\"%d\\n\",s[d]);\n d++;\n }\n}",
"main(n,t,i,d){\n d=0;\n int s[17] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n while(d < 17){\n printf(\"%d\\n\",s[d]);\n d++;\n }\n}",
"main(n,t,i,d){\n d=0;\n int s[17] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n while(d < 17) printf(\"%d\\n\",s[d++]);\n}",
"main(n,t,i,d){\n d=0;\n int s[] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n while(d < 17) printf(\"%d\\n\",s[d++]);\n}",
"main(t,i,d){\n d=0;\n int s[] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\n while(d < 17) printf(\"%d\\n\",s[d++]);\n}",
"d,s[] = {3,4,4,3,6,4,1,5,3,3,4,149,3,3,0,5,1};\nmain()\n{\n\tfor(;d < 17;printf(\"%d\\n\",s[d++])) ;\n}",
"main(){\n puts(\"3\\n4\\n4\\n3\\n6\\n4\\n1\\n5\\n3\\n3\\n4\\n149\\n3\\n3\\n0\\n5\\n1\");\n}",
"main(){puts(\"3\\n4\\n4\\n3\\n6\\n4\\n1\\n5\\n3\\n3\\n4\\n149\\n3\\n3\\n0\\n5\\n1\");}",
"main(){puts(\"3\\n4\\n4\\n3\\n6\\n4\\n1\\n5\\n3\\n3\\n4\\n149\\n3\\n3\\n0\\n5\\n1\");}"
],
"1_2822": [
"#include <stdio.h>\n\nint main() {\n\tint t, n, a, b, c;\n\n\tscanf(\"%d\", &t);\n\tif (t < 1 || t>10000)\n\t\treturn 0;\n\tfor (int i = 0; i < t; i++) {\n\t\tscanf(\"%d\", &n);\n\t\tif (n < 1 || n>10000)\n\t\t\treturn 0;\n\t\ta = 0; b = 0; c = 0;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\ta += i;\n\t\t\tb += (2 * i) - 1;\n\t\t\tc += 2 * i;\n\n\t\t}\n\t\tprintf(\"%d %d %d\\n\", a, b, c);\n\t}\n\t\n\t\n\treturn 0;\n}",
"#include <stdio.h>\n\n\nstruct rr\n{\n\tint n,n1,f,u;\n}a[10000];\nvoid main()\n{\n\tint t,n,n1,s=0,f,u;\n\tscanf(\"%d\",&t);\n\tif(t<1 || t>10000)\n\t{\n\t\tprintf(\"try again\");\n\t\tscanf(\"%d\",&t);\n\t}\n\telse\n\t{\n\t\tfor(int i=0;i<t;i++)\n\t\t{\n\t\t\tscanf(\"%d\",&n);\n\t\t\tif(n<1 || n>10000)\n\t\t\t{\n\t\t\t\tprintf(\"try again\");\n\t\t\t\tscanf(\"%d\",&n);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ta[i].n=n;\n\t\t\t\ta[i].n1=((a[i].n*(a[i].n+1))/2);\n\t\t\t\ts=a[i].n1-a[i].n;\n\t\t\t\ta[i].f=s+a[i].n1;\n\t\t\t\ta[i].u=a[i].f+a[i].n;\n\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tfor(int j=0;j<t;j++)\n\t\t{\n\t\t\tprintf(\"%d %d %d\",a[j].n1,a[j].f,a[j].u);\n\t\t\tprintf(\"\\n\");\n\t\t}\n\n\t}\n \n}",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n // printf(\"please Enter number case test\\n\");\n int t;\n scanf(\"%d\",&t);\n int a,b,c,d;\n for(a=0;a<t;a++){\n int N;\n // printf(\"please enter nember \\n\");\n scanf(\"%d\",&N);\n int s1=0;\n int s2=0;\n int s3=0;\n for(b=1;b<=N;b++)\n s1+=b;\n printf(\"%d \",s1);\n for(c=1;c<=2*N-1;c=c+2)\n s2+=c;\n printf(\"%d \",s2);\n for(d=0;d<=2*N;d=d+2)\n s3+=d;\n printf(\"%d\\n\",s3);\n }\n return 0;\n\n}\n\n",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n int tc, n, i, sum;\n scanf(\"%d\", &tc);\n while (tc--)\n {\n scanf(\"%d\", &n);\n sum = 0;\n for (i=1; i<=n; i++)\n {\n sum += i;\n }\n printf(\"%d \", sum);\n\n sum = 0;\n for (i=1; i<=(2*n); i=i+2)\n {\n sum += i;\n }\n printf(\"%d \", sum);\n\n sum = 0;\n for (i=2; i<=(2*n); i=i+2)\n sum += i;\n printf(\"%d\\n\", sum);\n }\n return 0;\n}\n",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n int tc,n,s1,s2,s3;\n scanf(\"%d\",&tc);\n while(tc>0){\n scanf(\"%d\",&n);\n s1=(n*(n+1))/2;\n s2=n*n;\n s3=n*(n+1);\n tc--;\n printf(\"%d %d %d\\n\",s1,s2,s3);}\n\n return 0;\n}\n",
"#define _POSIX_C_SOURCE 200809L\n\n#include <stdio.h>\n#include <stdbool.h>\n#include <stdlib.h>\n\nint get_int (void) {\n\n static char *line = NULL;\n static size_t len = 0;\n ssize_t read;\n\n read = getline(&line, &len, stdin);\n\n int i;\n sscanf(line, \"%d\", &i);\n return i;\n}\n\nvoid solve_problem (int input, int *positive, int *odd, int *even) {\n *even = input * (input + 1);\n *positive = *even / 2;\n *odd = *even - input;\n}\n\n\nint main (int argc, char *argv[]) {\n\n int count = get_int();\n for (int i = 0; i < count; i++) {\n int input = get_int();\n int positive, odd, even;\n solve_problem(input, &positive, &odd, &even);\n printf(\"%d %d %d\\n\", positive, odd, even);\n }\n\n return EXIT_SUCCESS;\n}\n",
"#include \"stdio.h\"\n#include \"stdlib.h\"\n\n\n\n\n\nmain(int argc, char const *argv[])\n{\n\t/* code */\n\n\tint c , i = 0, z, sp1 = 0 , sp2 = 0 , sp3 = 0;\n\tint *intp = (int*)malloc(sizeof(int));\n\tscanf(\"%d\",&c);\n\tfor(i;i<c;i++){\n\t\tscanf(\"%d\",&intp[i]);\n\t}\n\tfor ( i=0 ; i<c ; i++){\n\t\tsp1 = 0;\n\t\tfor(z=0;z<=intp[i] ; z++){\n\t\t\tsp1 = sp1 + z;\n\t\t}\n\t\tprintf(\"%d \",sp1);\n\t\tsp2 = 0;\n\t\tfor(z=1;z<(2*intp[i]) ; z = z + 2){\n\t\t\tsp2 = sp2 + z;\n\t\t}\n\t\tprintf(\"%d \",sp2);\n\t\tsp3 = 0;\n\t\tfor(z=0;z<=(2*intp[i]) ; z = z + 2){\n\t\t\tsp3 = sp3 + z;\n\t\t}\n\t\tprintf(\"%d\\n\",sp3);\n\t}\n}\n",
"#include \"stdio.h\"\n#include \"stdlib.h\"\n\n\n\n\n\nmain(int argc, char const *argv[])\n{\n\t/* code */\n\n\tint c , i = 0, z, sp1 = 0 , sp2 = 0 , sp3 = 0;\n\tint *intp = (int*)malloc(sizeof(int));\n\tscanf(\"%d\",&c);\n\tfor(i;i<c;i++){\n\t\tscanf(\"%d\",&intp[i]);\n\t}\n\tfor ( i=0 ; i<c ; i++){\n\t\tsp1 = 0;\n\t\tfor(z=0;z<=intp[i] ; z++){\n\t\t\tsp1 = sp1 + z;\n\t\t}\n\t\tprintf(\"%d \",sp1);\n\t\tsp2 = 0;\n\t\tfor(z=1;z<(2*intp[i]) ; z = z + 2){\n\t\t\tsp2 = sp2 + z;\n\t\t}\n\t\tprintf(\"%d \",sp2);\n\t\tsp3 = 0;\n\t\tfor(z=0;z<=(2*intp[i]) ; z = z + 2){\n\t\t\tsp3 = sp3 + z;\n\t\t}\n\t\tprintf(\"%d\\n\",sp3);\n\t}\n}\n",
"#include <stdio.h>\n\n\n\nint main()\n{\nint n,n1,n2,t,i;\nscanf (\"%d\",&t);\nfor(i=0;i<t;i++)\n{scanf (\"%d\",&n);\nn1=n*n+n;\nn2=n*n;\nprintf (\"%d %d %d\\n\",n1/2,n2,n1);}\n\n\n \nreturn 0;\n}",
"#include <stdio.h>\n\n\nint main()\n{\n\tint times; \n\tscanf(\"%d\", ×);\n\tfor (int t = 0; t < times; t++)\n\t{\n\t\tint x;\n\t\tscanf(\"%d\", &x);\n\t\tlong int s1 = 0, s2 = 0, s3 = 0;\n\n\t\tfor (int i = 1; i <= x; i++)\n\t\t{\n\t\t\ts1 += i;\n\t\t}\n\n\t\tint odds = 1;\n\t\tfor (int i = 1;; )\n\t\t{\n\t\t\tif (odds > x)\tbreak;\n\n\t\t\tif (i % 2 == 1)\n\t\t\t{\n\t\t\t\todds++;\n\t\t\t\ts2 += i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\n\t\tint evens = 1;\n\t\tfor (int i = 1;;)\n\t\t{\n\t\t\tif (evens > x)\tbreak;\n\n\t\t\tif (i % 2 == 0)\n\t\t\t{\n\t\t\t\tevens++;\n\t\t\t\ts3 += i;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\n\t\tprintf(\"%d %d %d\\n\", s1, s2, s3);\n\t}\n\n\treturn 0;\n}\n",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint num[10010][4], i, j = 0, k = 1, s = 0;\n\tscanf(\"%d\", &num[0][0]);\n\tfor (i = 1; i <= num[0][0]; i++)\n\t{\n\t\tscanf(\"%d\", &num[i][0]);\n\t}\n\tfor (i = 1; i <= num[k][0]; i++)\n\t{\n\t\ts += i;\n\t\tif (i == num[k][0])\n\t\t{\n\t\t\tnum[k][1] = s;\n\t\t\ti = 0;\n\t\t\ts = 0;\n\t\t\tk++;\n\t\t}\n\t\tif (k == num[0][0] + 1)\n\t\t{\n\t\t\ts = 0;\n\t\t\tk = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\n\tfor (i = 1;; i += 2)\n\t{\n\t\tj++;\n\t\ts += i;\n\t\tif (j == num[k][0])\n\t\t{\n\t\t\tnum[k][2] = s;\n\t\t\tk++;\n\t\t\ts = 0;\n\t\t\ti = -1;\n\t\t\tj = 0;\n\t\t}\n\t\tif (k == num[0][0] + 1)\n\t\t{\n\t\t\ts = 0;\n\t\t\tk = 1;\n\t\t\tj = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\n\tfor (i = 2;; i += 2)\n\t{\n\t\tj++;\n\t\ts += i;\n\t\tif (j == num[k][0])\n\t\t{\n\t\t\tnum[k][3] = s;\n\t\t\tk++;\n\t\t\ts = 0;\n\t\t\ti = 0;\n\t\t\tj = 0;\n\t\t}\n\t\tif (k == num[0][0] + 1)\n\t\t{\n\t\t\ts = 0;\n\t\t\tk = 1;\n\t\t\tj = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor (i = 1; i <= num[0][0]; i++)\n\t{\n\t\tfor (j = 1; j<3; j++)\n\t\t{\n\t\t\tprintf(\"%d \", num[i][j]);\n\t\t}\n\t\tprintf(\"%d\", num[i][3]);\n\t\tprintf(\"\\n\");\n\t}\n\treturn 0;\n}\n",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint num[10010][4], i, j = 0, k = 1, s = 0;\n\tscanf(\"%d\", &num[0][0]);\n\tfor (i = 1; i <= num[0][0]; i++)\n\t{\n\t\tscanf(\"%d\", &num[i][0]);\n\t}\n\tfor (i = 1; i <= num[k][0]; i++)\n\t{\n\t\ts += i;\n\t\tif (i == num[k][0])\n\t\t{\n\t\t\tnum[k][1] = s;\n\t\t\ti = 0;\n\t\t\ts = 0;\n\t\t\tk++;\n\t\t}\n\t\tif (k == num[0][0] + 1)\n\t\t{\n\t\t\ts = 0;\n\t\t\tk = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\n\tfor (i = 1;; i += 2)\n\t{\n\t\tj++;\n\t\ts += i;\n\t\tif (j == num[k][0])\n\t\t{\n\t\t\tnum[k][2] = s;\n\t\t\tk++;\n\t\t\ts = 0;\n\t\t\ti = -1;\n\t\t\tj = 0;\n\t\t}\n\t\tif (k == num[0][0] + 1)\n\t\t{\n\t\t\ts = 0;\n\t\t\tk = 1;\n\t\t\tj = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\n\tfor (i = 2;; i += 2)\n\t{\n\t\tj++;\n\t\ts += i;\n\t\tif (j == num[k][0])\n\t\t{\n\t\t\tnum[k][3] = s;\n\t\t\tk++;\n\t\t\ts = 0;\n\t\t\ti = 0;\n\t\t\tj = 0;\n\t\t}\n\t\tif (k == num[0][0] + 1)\n\t\t{\n\t\t\ts = 0;\n\t\t\tk = 1;\n\t\t\tj = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor (i = 1; i <= num[0][0]; i++)\n\t{\n\t\tfor (j = 1; j<3; j++)\n\t\t{\n\t\t\tprintf(\"%d \", num[i][j]);\n\t\t}\n\t\tprintf(\"%d\", num[i][3]);\n\t\tprintf(\"\\n\");\n\t}\n\treturn 0;\n}\n",
"#define s ~scanf(\"%d\",&n);\nmain(n) {\n for(s s)\n printf(\"%d %d %d\\n\",n+n*n>>1,n*n,n*n+n);\n}",
"#define s ~scanf(\"%d\",&n);\nmain(int n) {\n for(s s printf(\"%d %d %d\\n\",n+n*n>>1,n*n,n*n+n));\n}"
],
"1_2847": [
"#include <stdio.h>\n#include <math.h>\n\nint main() {\n int tcc, counter; scanf(\"%d\", &tcc);\n\n while (tcc--) {\n scanf(\"%d\", &counter);\n int temp;\n double max = -1, min = 150, total = 0;\n for (int i = 0; i < counter; i++) {\n scanf(\"%d\", &temp);\n total += temp;\n max = max < temp? temp: max;\n min = min > temp? temp: min;\n }\n// printf(\"total %lf avg %lf min %lf max %lf diff %lf\\n\", total, total/counter, min, max, (max + min) / 2);\n if (fabs((max + min) / 2 - total / counter) < 1)\n printf(\"Yes\\n\");\n else\n printf(\"No\\n\");\n }\n return 0;\n}",
"#include <stdio.h>\nint main(){\n float A[50000];\n float B[50000];\n int bool[50000];\n int smallest=0;\n int biggest=0;\n float c;\n int studentgrades[50000];\n int numberofset;\n int numberofstudents;\n int temp;\n scanf(\"%d\",&numberofset);\n for(int i=0;i<numberofset;i++){\n numberofstudents=0;\n scanf(\"%d\",&numberofstudents);\n for(int j=0;j<numberofstudents;j++){\n studentgrades[j]=0;\n }\n for(int k=0;k<numberofstudents;k++){\n\n scanf(\"%d\",&temp);\n if(k==0){\n smallest=temp;\n biggest=smallest;\n }\n studentgrades[k]=temp;\n B[i]+=temp;\n }\n B[i]/=numberofstudents;\n for (int m = 0; m < numberofstudents; m++) {\n if (studentgrades[m] < smallest) {\n smallest = studentgrades[m];\n }\n }\n\n\n for (int n = 0; n < numberofstudents; n++) {\n if (biggest <studentgrades[n] ) {\n biggest = studentgrades[n];\n }\n }\n\n A[i]=biggest+smallest;\n A[i]/=2;\n c=A[i]-B[i];\n if(c<0){\n c*=-1;\n }\n\n if(c<1 && c>=0 ){\n bool[i]=1;\n }\n else{\n bool[i]=0;\n }\n\n }\n\n for(int i=0;i<numberofset;i++){\n if(bool[i]==1){\n printf(\"Yes\");\n }\n else{\n printf(\"No\");\n }\n printf(\"\\n\");\n// if(i!=numberofset-1){\n// printf(\"\\n\");\n// }\n\n\n }\n}\n",
"#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n\tint T,i,j,mn,mx,t2,t,n;\n\tdouble t1,t3;\n\tscanf(\"%d\",&T);\n\tfor(i=0;i<T; i++)\n\t{\n\t\tscanf(\"%d\",&n);\n\t\tmn = 999;\n\t\tmx = 0;\n\t\tt2=0;\n\t\tfor(j=0;j<n;j++)\n\t\t{\n\t\t\tscanf(\"%d\",&t);\n\t\t\tt2+=t;\n\t\t\tif(t<mn)\n\t\t\t\tmn=t;\n\t\t\telse if(t>mx)\n\t\t\t\tmx=t;\n\t\t}\n\t\tt1 = (mn+mx)/2.0;\n\t\tt3 = (double) t2/n;\n\t\tabs(t1-t3)<1.0? printf(\"Yes\\n\"): printf(\"No\\n\");\n\t}\n}"
],
"7_1002": [
"#include<stdio.h> \nint a,b; \nint main(){ \n for(;scanf(\"%d\",&a)>0;b^=a);printf(\"%d\\n\",b);\n} ",
"int a,b;int main(){for(;scanf(\"%d\",&a)>0;b^=a);printf(\"%d\\n\",b);}",
"int a,b;main(){for(;scanf(\"%d\",&a)>0;b^=a);printf(\"%d\\n\",b);} ",
"int a,b;main(){for(;scanf(\"%d\",&a)>0;b^=a);printf(\"%d\\n\",b);}"
],
"5_8505": [
"// #include<iostream>\n// #include<cstdio>\n// #include<vector>\n// using namespace std;\n\n// unsigned power(unsigned x,unsigned y)\n// {\n// unsigned returnValue=1,i=y;\n// while(i>0)\n// {\n// returnValue = returnValue * x;\n// i--;\n// }\n// return returnValue;\n// }\n\n// unsigned getinlog2(unsigned n)\n// {\n// unsigned returnValue = -1;\n// while (n){\n// returnValue = returnValue + 1;\n// n>>=1;\n// } \n \n// return returnValue;\n// }\n\n\n// unsigned possibles(unsigned m,unsigned k)\n// {\n// unsigned x = power(2,k);\n// if(k<0)return 0;\n// if(k==0)return 1;\n// if(m==0)return 1;\n// if(m>=x)return possibles(m-x,k)+possibles(m,k-1);\n// else return possibles(m,k-1);\n\n// }\n\n// unsigned main()\n// {\n// unsigned n=0;\n// unsigned m=0;\n// vector<unsigned> v;\n// scanf(\"%d\",&n);\n// while(n!=0)\n// {\n// scanf(\"%d\",&m);\n// unsigned k=getinlog2(m);\n// v.push_back(possibles(m,k));\n// n--;\n// }\n// for(unsigned i=0;i<v.size();i++)\n// prunsignedf(\"%d\\n\",v[i]);\n// return 0;\n// }\n#include <stdio.h>\n#include <stdlib.h>\n\nunsigned long long countingPartition(unsigned a){\n if(a<2){\n return 1;\n }\n //unsigned long long array[a+1];\n unsigned long long tmp;\n unsigned long long * array;\n array = (unsigned long long*) calloc (a+1,sizeof(unsigned long long));\n unsigned b=1;\n unsigned c=a/2;\n array[0]=1;\n for(unsigned i=1;i<=a;i++){\n array[i] = 0;\n }\n while(b<=c){\n b=b<<1;\n }\n while(b!=0){\n unsigned i=b;\n while(i<=a){\n tmp = array[i]+array[i-b];\n array[i] = tmp % 1000000;\n i=i+b;\n }\n b=b/2;\n }\n return array[a];\n}\n\nint main(void) {\n unsigned n;\n unsigned tmp;\n unsigned long m;\n scanf(\"%d\", &n);\n tmp=n;\n unsigned long long * pData;\n pData = (unsigned long long*) calloc (n+1,sizeof(unsigned long long));\n //if (pData==NULL) exit (1);\n //unsigned long long array[n+1];\n for(unsigned i=1;i<=n;i++){\n pData[i] = 0;\n }\n\n while(n!=0) {\n scanf(\"%ld\", &m);\n \n pData[n] = countingPartition(m) % 1000000;\n n--;\n \n }\n for(unsigned i=tmp;i>0;i--){\n printf(\"%lld\\n\", pData[i]);\n }\n\n free(pData);\n return 0;\n}\n\n",
"\n#include <stdio.h>\n#include <stdlib.h>\n\nunsigned long long countingPartition(unsigned a){\n if(a<2){\n return 1;\n }\n unsigned long long tmp;\n unsigned long long * array;\n array = (unsigned long long*) calloc (a+1,sizeof(unsigned long long));\n unsigned b=1;\n unsigned c=a/2;\n array[0]=1;\n for(unsigned i=1;i<=a;i++){\n array[i] = 0;\n }\n while(b<=c){\n b=b<<1;\n }\n while(b!=0){\n unsigned i=b;\n while(i<=a){\n tmp = array[i]+array[i-b];\n array[i] = tmp % 1000000;\n i=i+b;\n }\n b=b/2;\n }\n return array[a];\n}\n\nint main(void) {\n unsigned n;\n unsigned tmp;\n unsigned long m;\n scanf(\"%d\", &n);\n tmp=n;\n unsigned long long * pData;\n pData = (unsigned long long*) calloc (n+1,sizeof(unsigned long long));\n for(unsigned i=1;i<=n;i++){\n pData[i] = 0;\n }\n\n while(n!=0) {\n scanf(\"%ld\", &m);\n \n pData[n] = countingPartition(m) % 1000000;\n n--;\n \n }\n for(unsigned i=tmp;i>0;i--){\n printf(\"%lld\\n\", pData[i]);\n }\n\n free(pData);\n return 0;\n}\n\n",
"#include<stdio.h>\n\nlong long int table[1000002];\nlong long int sum_table[1000002];\n\nvoid fill_table(){\n\ttable[0] = 1;\n\tsum_table[0] = 1;\n\tint i;\n\tfor(i = 1; i < 1000002; i++){\n\t\ttable[i] += sum_table[i/2];\n\t\tsum_table[i] = (sum_table[i-1] + table[i]) % 1000000;\n\t}\n}\n/* \nint func(int n){\n\tif(n == 0)\n\t\treturn 1;\n\tint sum = 0;\n\tint i;\n\tfor(i = 0; i <= n/2; i++)\n\t\tsum += func(i);\n\treturn sum;\n}\n */\n\nint main()\n{\n\tfill_table();\n int count;\n\tscanf(\"%d\", &count);\n\tint i;\n for(i = 0; i < count; i++){\n\t\t//if(i)\n\t\t//\tprintf(\"\\n\");\n\t\tint m;\n\t\tscanf(\"%d\", &m);\n printf(\"%lld\\n\", sum_table[m/2]);\n }\n return 0;\n}",
"#include<stdio.h>\n\nlong long int table[1000002];\nlong long int sum_table[1000002];\n\nvoid fill_table(){\n\ttable[0] = 1;\n\tsum_table[0] = 1;\n\tint i;\n\tfor(i = 1; i < 1000002; i++){\n\t\ttable[i] += sum_table[i/2];\n\t\tsum_table[i] = (sum_table[i-1] + table[i]) % 1000000;\n\t}\n}\nint main()\n{\n\tfill_table();\n int count;\n\tscanf(\"%d\", &count);\n\tint i;\n for(i = 0; i < count; i++){\n\t\tint m;\n\t\tscanf(\"%d\", &m);\n printf(\"%lld\\n\", sum_table[m/2]);\n }\n return 0;\n}"
],
"7_1001": [
"int main(){int a,b;while(scanf(\"%d %d\",&a,&b)>0)printf(\"%d\\n\",a+b);}",
"int main(){int a,b;while(scanf(\"%d %d\",&a,&b)>0)printf(\"%d\\n\",a+b);}",
"int main(){int a,b;while(scanf(\"%d %d\",&a,&b)>0)printf(\"%d\\n\",a+b);}",
"int main(){int a,b;while(scanf(\"%d %d\",&a,&b)>0)printf(\"%d\\n\",a+b);}"
],
"1_2857": [
"#include<stdio.h>\n\nint maximumAndis(long long int ar[], int length) {\n\n\tint andis = 0;\n\tint i;\n\tfor (i = 1; i < length; i++)\n\t{\n\t\tif (ar[i] > ar[andis])\n\t\t\tandis = i;\n\n\t}\n\treturn andis;\n\n\n}\n\nint minimumAndis(long long int ar[], int length) {\n\n\tint andis = 0;\n\tint i;\n\tfor (i = 0; i < length; i++)\n\t{\n\t\tif (ar[i] < ar[andis])\n\t\t\tandis = i;\n\n\t}\n\treturn andis;\n}\n\nvoid maxMinusMin(long long int ar[], int length)\n{\n\tint i;\n\tint maxAndis;\n\tint minAndis;\n\tmaxAndis = maximumAndis(ar, length);\n\tminAndis = minimumAndis(ar, length);\n\tar[maxAndis] = ar[minAndis] = ar[maxAndis] - ar[minAndis];\n}\n\nint checkEqual(long long int ar[], int length)\n{\n\n\tfor (int i = 1; i < length; i++)\n\t\tif (ar[i] != ar[0])\n\t\t\treturn -1;\n\treturn 1;\n}\n\nint main()\n{\n\tint t, n;\n\tlong long int x[10] = { 0 };\n\tscanf(\"%d\", &t);\n\twhile (t)\n\t{\n\t\tscanf(\"%d\", &n);//n is the length\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tscanf(\"%lld\", &x[i]);\n\t\twhile (checkEqual(x, n) == -1)\n\t\t{\n\t\t\tmaxMinusMin(x, n);\n\t\t}\n\t\tprintf(\"%lld\", x[0]);\n\t\tprintf(\"\\n\");\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tx[i] = 0;\n\t\t//we should clean the array\n\t\tt--;\n\n\t}//end t while\n\n\n}",
"#include <stdio.h>\n#include<stdlib.h>\n#include<string.h>\n\nvoid ReplaceAmB(int nums[], int len);\nint All(int nums[], int len);\n\nint main() {\n\n\t/*FILE* f; \n\t f=fopen(\"1.txt\", \"r\");*/\n\t char str[255];\n\t\n//\tfscanf(f,\"%s\\n\", &str);\n\t scanf( \"%s\\n\", &str);\n\tint TestCase = 0;\n\tTestCase= atoi(str);\n\tfor (int i = 0; i < TestCase; i++)\n\t{\n\t\t//fscanf(f, \"%s\\n\", &str);\n\t\tscanf(\"%s\\n\", &str);\n\t\tint n = atoi(str);\n\t\t\n\t\tint* xi = (int*)malloc(sizeof(int)*n);\n\t\tfor (int j = 0; j < n; j++)\n\t\t{\n\t\t\tscanf(\"%s\\n\", &str);\n\t\t\t//fscanf(f, \"%s\\n\", &str);\n\t\t\txi[j]=atoi(str);\n\t\t}\n\t\t//operate\n\t\twhile (!All(xi, n))\n\t\t{\n\t\t\tReplaceAmB(xi, n);\n\t\t}\n\t\tprintf(\"%d\\n\", xi[0]);\n\t\t//\n\t\tfree(xi);\n\n\t}\n\n\treturn 0;\n}\n\nint All(int nums[], int len)\n{\n\tint u = nums[0];\n\tfor (int i = 1; i < len; i++)\n\t{\n\t\tif (u!=nums[i])\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}\n\treturn 1;\n}\n\nvoid ReplaceAmB(int nums[], int len)\n{\n\t\n\tint max = nums[0];\n\tint indMax = 0;\n\tint min = nums[0];\n\tint indMin = 0;\n\tfor (int i = 1; i < len; i++)\n\t{\n\t\tif (nums[i]>max)\n\t\t{\n\t\t\tmax = nums[i];\n\t\t\tindMax = i;\n\t\t}\n\t\tif (nums[i]<min)\n\t\t{\n\t\t\tmin = nums[i];\n\t\t\tindMin = i;\n\t\t}\n\t}\nint\ty = max - min;\n\tnums[indMin] = y;\n\tnums[indMax] = y;\n\n}",
"#include <stdio.h>\nint main()\n{\n\tint n,i,j,counter, memMax, memMin, T ;\n\tlong x[20], z[20] , Max , Min , Minus ;\n\tscanf(\"%d\", &T) ;\n\tfor ( j=1 ; j<=T ; j++ )\n\t{\n\tscanf(\"%d\",&n) ;\n\tfor ( i = 0 ; i < n ; i++)\n\t\tscanf(\"%d\",&x[i]) ;\n\twhile(1)\n\t{\n\tcounter=0;\n\tfor ( i=0 ; i < n-1 ; i++)\n\tif (x[i] == x[i+1])\n\t++counter ;\n\tif ( counter == (n-1))\n\t{\n\t\tz[j]=x[0];\n\tbreak ;\n\t}\n\t\n\telse\n\t{\n\t\tfor ( i=0; i<n ; i++)\n\t\t{\n\t\t\tif ( i == 0 )\n\t\t\t{\n\t\t\tMax = x[i] ;\n\t\t\tMin = x[i] ;\n\t\t\tmemMax=memMin= i ;\n\t\t\t}\n\t\t\telse \n\t\t\tif ( x[i] > Max)\n\t\t\t{\n\t\t\tMax = x[i] ;\n\t\t\tmemMax = i ;\n\t\t\t}\n\t\t\telse if ( x[i] < Min)\n\t\t\t{\n\t\t\tMin = x[i] ;\n\t\t\tmemMin = i ;\n\t\t\t}\n\t\t}\n\t\tMinus = Max - Min ;\n\t\ti = memMax ;\n\t\tx[i] = Minus ;\n\t\ti = memMin ;\n\t\tx[i] = Minus ;\n\t}\n\t}\n\t}\n\tfor(j=1; j<=T ; j++)\n\t\tprintf(\"%d\\n\", z[j]) ;\n}",
"#include<stdio.h>\nint main()\n{\n\tint long x[10];\n\tint t, n, y,k,i,j, item;\n\tscanf(\"%d\", &t);\n\tfor(k=0;k<t;k++)\n\t{\n\t\tscanf(\"%d\", &n);\n\t\tfor(i=0; i<n; i++)\n\t\t\tscanf(\"%d\", &x[i]);\n\t\twhile(1)\n\t\t{\n\t\t\tfor(i=n-1; i>0; i--)\n\t\t\t{\n\t\t\t\tfor(j=0; j<i; j++)\n\t\t\t\t{\n\t\t\t\t\tif(x[j]>x[j+1])\n\t\t\t\t\t{\n\t\t\t\t\t\titem=x[j];\n\t\t\t\t\t\tx[j]=x[j+1];\n\t\t\t\t\t\tx[j+1]=item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(x[n-1] == x[0]){\n\t\t\t\tprintf(\"%d\\n\", x[0]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tx[n-1]=x[n-1]-x[0];\n\t\t\t\tx[0]=x[n-1];\n\t\t\t}\n\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\n\t\t\t\t\n\t}\n\treturn 0;\n}"
],
"1_2858": [
"#include <stdio.h>\n#include<stdlib.h>\n#include<string.h>\n\n\n\nint main() {\n\n\t//FILE* f; \n\t// f=fopen(\"1.txt\", \"r\");\n\t char str[255];\n\t\n\t//fscanf(f,\"%s\\n\", &str);\n\t scanf( \"%s\\n\", &str);\n\tint TestCase = 0;\n\tTestCase= atoi(str);\n\tfor (int i = 0; i < TestCase; i++)\n\t{\n\t\t//fscanf(f, \"%s\\n\", &str);\n\t\tscanf(\"%s\\n\", &str);\n\t\tint N = atoi(str);\n\t\t//fscanf(f, \"%s\\n\", &str);\n\t\tscanf(\"%s\\n\", &str);\n\t\tint M = atoi(str);\n\t\t\n\t\tint* Ni = (int*)malloc(sizeof(int)*N);\n\t\tfor (int j = 0; j < N; j++)\n\t\t{\n\t\t\tscanf(\"%s\\n\", &str);\n\t\t\t//fscanf(f, \"%s\\n\", &str);\n\t\t\tNi[j]=atoi(str);\n\t\t}\n\n\t\tint* Mi = (int*)malloc(sizeof(int)*M);\n\t\tfor (int j = 0; j < M; j++)\n\t\t{\n\t\t\tscanf(\"%s\\n\", &str);\n\t\t\t//fscanf(f, \"%s\\n\", &str);\n\t\t\tMi[j] = atoi(str);\n\t\t}\n\t\t//operate\n\t\tint MaxSeq=0;\n\t\tfor (int i = 0; i < N; i++)\n\t\t{\n\t\t\t\tfor (int m = 0; m < M; m++)\n\t\t\t\t{\n\t\t\t\t\tif (Mi[m]!=NULL && Mi[m]==Ni[i])\n\t\t\t\t\t{\n\t\t\t\t\t\tMaxSeq++;\n\t\t\t\t\t\tMi[m] = NULL;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\", MaxSeq);\n\t\t//\n\t\tfree(Ni);\n\t\tfree(Mi);\n\t}\n\n\treturn 0;\n}\n\n",
"#include<stdio.h>\n\nint deleteCell(long int a[], int n, int index)\n{\n\tint i;\n\tfor (i = index; i < n - 1; i++)\n\t\ta[i] = a[i + 1];\n\treturn n - 1;\n}\n\nint problemB(long int arMax[], long int arMin[],int maxLen,int minLen){\n\tint result = 0;\n\tfor (int i = 0; i < maxLen; i++)\n\t{\n\t\tfor (int j = 0; j < minLen; j++)\n\t\t{\n\t\t\tif (arMax[i] == arMin[j]){\n\t\t\t\tresult++;\n\t\t\t\tminLen = deleteCell(arMin, minLen, j);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\nint main() {\n\n\tint t,m,n;// 1 <= t <= 64\n\tlong int ar1[10000], ar2[10000];\n\tint max;\n\tint pp;\n\tscanf(\"%d\", &t);\n\twhile (t--) {\n\t\tpp = 3;\n\t\tscanf(\"%d%d\", &m, &n);\n\t\tif (m >= n)\n\t\t\tmax = m;\n\t\telse\n\t\t\tmax = n;\n\t\tfor (int i = 0; i < m; i++)\n\t\t{\n\t\t\tscanf(\"%ld\", &ar1[i]);\n\t\t}\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tscanf(\"%ld\", &ar2[i]);\n\t\t}\n\t\tif (max = m){\n\t\t\tprintf(\"%d\", problemB(ar1, ar2, m, n));\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\telse {\n\t\t\tprintf(\"%d\", problemB(ar2, ar1, n, m));\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\t}\n}",
"#include<stdio.h>\nint main()\n{\n\tint t,m,n,z,i,j,x[10000],y[10000],co,item,sum,k;\n\tscanf(\"%d\", &t);\n\tfor(z=0;z<t;z++)\n\t{\n\t\tscanf(\"%d\", &m);\n\t\tscanf(\"%d\", &n);\n\t\tfor( i=0;i<m;i++)\n\t\t\tscanf(\"%d\", &x[i]);\n\t\tfor( i=0;i<n;i++)\n\t\t\tscanf(\"%d\", &y[i]);\n\t\tco=0;\n\t\tsum=0;\n\t\tfor(i=0;i<m;i++)\n\t\t{\n\t\t\tfor(j=0;j<n-sum;j++)\n\t\t\t{\n\t\t\t\tif(x[i]==y[j])\n\t\t\t\t{\n\t\t\t\t\tco++;\n\t\t\t\t\titem=y[n-1-sum];\n\t\t\t\t\ty[n-1-sum]=y[j];\n\t\t\t\t\ty[j]=item;\n\t\t\t\t\tsum++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tprintf(\"%d\\n\",co);\n\t}\n\treturn 0;\n}"
],
"1_2859": [
"#include <stdio.h>\n#include<stdlib.h>\n#include<string.h>\n\n\n\nint main() {\n\n\t/*FILE* f; \n\t f=fopen(\"1.txt\", \"r\");*/\n\t char str[255];\n\t\n //fscanf(f,\"%s\\n\", &str);\n\t scanf( \"%s\\n\", &str);\n\tint TestCase = 0;\n\tTestCase= atoi(str);\n\tfor (int i = 0; i < TestCase; i++)\n\t{\n\t\t//fscanf(f, \"%s\\n\", &str);\n\tscanf(\"%s\\n\", &str);\n\t\tint N = atoi(str);\n\t\n\t\t\n\t\tint* Fi = (int*)malloc(sizeof(int)*N);\n\t\tint* Di = (int*)malloc(sizeof(int)*N);\n\t\tint* Ti = (int*)malloc(sizeof(int)*N);\n\t\tfor (int j = 0; j < N; j++)\n\t\t{\n\t\t\tscanf(\"%s\\n\", &str);\n\t//fscanf(f, \"%s\\n\", &str);\n\t\t\tFi[j]=atoi(str);\n\n\t\t\tscanf(\"%s\\n\", &str);\n\t\t\t//fscanf(f, \"%s\\n\", &str);\n\t\t\tDi[j] = atoi(str);\n\n\t\t\tTi[j] = Fi[j] - Di[j];\n\t\t}\n\n\t\n\t\t//operate\n\t\tint ind = 0;\n\n\t\tfor ( ind = 0; ind < N; ind++)\n\t\t{\n\t\t\tint i = (ind+1)%N;//start point\n\t\t\tint Fuel = Ti[ind];//initialize fuel\n\t\t\n\t\t\tif (Fuel<0)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tint can = 1;\n\t\t\twhile (i != ind)\n\t\t\t{\n\t\t\t\tFuel += Ti[i];\n\t\t\t\tif (Fuel<0)\n\t\t\t\t{\n\t\t\t\t\tcan = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\ti = i%N;\n\t\t\t\t/*if (i==N)\n\t\t\t\t{\n\t\t\t\t\ti == 0;\n\t\t\t\t}*/\n\t\t\t}\n\t\t\tif (can==1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (ind==N)\n\t\t{\n\t\t\tprintf(\"it's a trap\\n\");\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\tprintf(\"%d\\n\", ind);\n\t\t}\n\t\t/*int a = 0;\n\t\tint b = 0;\n\t\tfor (int i = 0; i < N; i++)\n\t\t{\n\t\t\tif (Fi[i]-Di[i]<0)\n\t\t\t{\n\t\t\t\ta++;\n\t\t\t\tb = i;\n\t\t\t}\n\t\t}\n\t\tif (a==1 || a==0)\n\t\t{\n\t\t\tprintf(\"%d\\n\", i);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"it\u2019s a trap\\n\", i);\n\t\t}*/\n\t\t//printf(\"%d\\n\", MaxSeq);\n\t\t//\n\t\tfree(Di);\n\t\tfree(Fi);\n\t\tfree(Ti);\n\t}\n\n\treturn 0;\n}\n\n",
"#include<stdio.h>\n\nint checkDifferentStart(int fuel[], int distance[], int start, int size)\n{\n\tint sum = 0;\n\tint i = 0;\n\tint tedadTekrareFor = 0;\n\tif (start == 0)\n\t{\n\t\tfor (i = 0; i < size; i++) {\n\t\t\tsum += (fuel[i] - distance[i]);\n\t\t\tif (sum < 0)\n\t\t\t\treturn -1;\n\t\t}\n\n\t}\n\telse {\n\t\ti = 0;\n\t\ti = 1;\n\t\ti = start;\n\t\tfor (i; i < size;i++)\n\t\t{\n\t\t\tsum += (fuel[i] - distance[i]);\n\t\t\tif (sum < 0)\n\t\t\t\treturn -1;\n\n\t\t}\n\t\tfor (i = 0; i < start; i++) {\n\t\t\tsum += (fuel[i] - distance[i]);\n\t\t\tif (sum < 0)\n\t\t\t\treturn -1;\n\n\t\t}\n\n\t}\n\n\treturn 1;\n}\n\nint main()\n{\n\tint t, n;// 1<=t<=256 // 2<=n<=10000\n\tint fuel[10000];\n\tlong int sumTrap=0;\n\tint distance[10000];\n\tscanf(\"%d\", &t);\n\n\twhile (t--) {\n\t\tscanf(\"%d\", &n);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tscanf(\"%d\", &fuel[i]);\n\t\t\tscanf(\"%d\", &distance[i]);\n\t\t\tsumTrap += fuel[i] - distance[i];\n\t\t}\n\n\t\tif (sumTrap >= 0) {\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tif (checkDifferentStart(fuel, distance, i, n) == 1) {\n\t\t\t\t\tprintf(\"%d\", i);\n\t\t\t\t\tprintf(\"\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (i == n - 1) {\n\t\t\t\t\t\tprintf(\"it's a trap\");\n\t\t\t\t\t\tprintf(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tprintf(\"it's a trap\");\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t}\n\n\n\n}\n\n",
"#include <stdio.h>\n\nint main() {\n\n\n int tedadmarahel, fuel = 0, h;\n scanf(\"%d\", &tedadmarahel);\n for (int tl = 0; tl < tedadmarahel; ++tl) {\n int ttt = 0;\n int tm;\n scanf(\"%d\", &tm);\n int s[10000][2];\n for (int i = 0; i < tm; ++i) {\n scanf(\"%d\", &s[i][1]);\n scanf(\"%d\", &s[i][0]);\n }\n for (int i = 0; i < tm; ++i) {\n fuel = 0;\n h = 0;\n int j = i;\n int ts = 0;\n while (ts <= tm) {\n fuel = 0;\n int distance = 0;\n fuel += s[j][1];\n distance += s[j][0];\n h += fuel;\n h -= distance;\n if (h < 0) { break; }\n fuel = fuel - distance;\n\n j += 1;\n ts += 1;\n if (j >= tm) { j = -1; }\n }\n if (ts == tm + 1) {\n if (ttt == 0) {\n printf(\"%d\\n\", i);\n ttt = 1;\n }\n }\n }\n\n if (ttt == 0)printf(\"it's a trap\\n\");\n }\n\n return 0;\n}",
"#include\"stdio.h\"\n\nint main()\n{\n\tint i, j, k, t, n, o, p;\n\tint m = 0;\n\tint a[10000][2];\n\tint b[256];\n\tscanf(\"%d\", &t);\n\tfor (o = 0; o < t; o++)\n\t{\n\t\tscanf(\"%d\", &n);\n\t\tfor (i = 0; i < n; i++)\n\t\t\tfor (j = 0; j < 2; j++)\n\t\t\t\tscanf(\"%d\", &a[i][j]);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tm = 0;\n\t\t\tfor (k = 0; k < n; k++)\n\t\t\t{\n\t\t\t\tj = (i + k) % n;\n\t\t\t\tm += a[j][0] - a[j][1];\n\t\t\t\tif (m < 0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (k == n)\n\t\t\t{\n\t\t\t\tb[o] = i;\n\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\t}\n\t\tif (i == n)\n\t\t\tb[o] = -1;\n\t}\n\tfor (o = 0; o < t; o++)\n\t\tif (b[o] == (-1))\n\t\t\tprintf(\"it's a trap\\n\");\n\t\telse\n\t\t\tprintf(\"%d\\n\", b[o]);\n\n\treturn 0;\n\n}"
]
}