>>27
イカサマぽいけど参考プログラムの
int a,b,c,d,a1,b1,r,e;を
__int64 a,b,c,d,a1,b1,r,e;にして
scanfとprintfの%dをすべて%I64dにすればいいんじゃないの?