#include <stdio.h>
#include <stdlib.h>
#include <time.h>
unsigned int x = 123456789;
unsigned int y = 362436069;
unsigned int z = 521288629;
unsigned int w = 88675123;
void seed(unsigned int a,unsigned int b,unsigned int c,unsigned int d) {
if((a|b|c|d)==0)return;
x=a;y=b;z=c;w=d;
}
unsigned int randint(void) {
unsigned int t;
t = x ^ (x << 11);
x = y; y = z; z = w;
return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
}
int main(void) {
const char* str[4]={"阿","澄","佳","奈"};
int prev[4]={};
int count=0;
int i;
for(i=0;i<4;i++) {
prev[i]=randint()%4;
count++;
}
for(;;) {
if(prev[0]==0 && prev[1]==1 && prev[2]==2 && prev[3]==3)break;
for(i=1;i<4;i++)prev[i-1]=prev[i];
prev[3]=randint()%4;
count++;
}
puts("\n\nあ、あ、あ、阿澄佳奈さんあすみいいいい~~~~~!!\n"); printf("%d回目で阿澄佳奈しました。\n",count
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4KCnVuc2lnbmVkIGludCB4ID0gMTIzNDU2Nzg5Owp1bnNpZ25lZCBpbnQgeSA9IDM2MjQzNjA2OTsKdW5zaWduZWQgaW50IHogPSA1MjEyODg2Mjk7CnVuc2lnbmVkIGludCB3ID0gODg2NzUxMjM7Cgp2b2lkIHNlZWQodW5zaWduZWQgaW50IGEsdW5zaWduZWQgaW50IGIsdW5zaWduZWQgaW50IGMsdW5zaWduZWQgaW50IGQpIHsKCWlmKChhfGJ8Y3xkKT09MClyZXR1cm47Cgl4PWE7eT1iO3o9Yzt3PWQ7Cn0KCnVuc2lnbmVkIGludCByYW5kaW50KHZvaWQpIHsKCXVuc2lnbmVkIGludCB0OwoJdCA9IHggXiAoeCA8PCAxMSk7Cgl4ID0geTsgeSA9IHo7IHogPSB3OwoJcmV0dXJuIHcgPSAodyBeICh3ID4+IDE5KSkgXiAodCBeICh0ID4+IDgpKTsKfQ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