杭电acm2114

#include <stdio.h>

int main() {
	
	__int64 n, ans;
	while(~scanf("%l64d", &n)) {
		n %= 10000;
		ans = (n*n*(n+1)*(n+1)) / 4;
		printf("%04d\n", ans%10000);
	}
	
	
	return 0;
}

posted @ 2015-11-26 14:14  StevenLuke  阅读(73)  评论(0编辑  收藏  举报