input
1 7 43 81
output
556810
被叉的题解
https://www.luogu.com.cn/article/a49gwvdz
https://www.luogu.com.cn/article/bpx7oqt8