#Lutece1717. 京电的神秘矩阵

京电的神秘矩阵

Migrated from Lutece 1717 京电的神秘矩阵

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

京电的主楼里发现一个m*n的矩阵。
该矩阵的第一列是ab,(a+1)b,......,(a+n1)ba^b,(a+1)^b,......,(a+n-1)^b
第二列是ab+1,(a+1)b+1,......,(a+n1)b+1a^{b+1},(a+1)^{b+1},......,(a+n-1)^{b+1}
.......
第m列是ab+m1,(a+1)b+m1,.....(a+n1)b+m1a^{b +m-1},(a+1)^{b+m-1},.....(a+n-1)^{b+m-1}

下面是一个4*4的矩阵:

22=4,23=8,24=16,25=322^2=4, 2^3=8, 2^4=16, 2^5=32
32=9,33=27,34=81,35=2433^2=9, 3^3=27, 3^4=81, 3^5=243
42=16,43=64,44=256,45=10244^2=16, 4^3=64, 4^4=256, 4^5=1024
52=25,53=125,54=625,55=31255^2=25, 5^3=125, 5^4=625, 5^5=3125

问这个矩阵里有多少不重复的数(比如24=422^4 = 4^2,这样的话就有重复了)
在出题的时候听到一首歌:全部都是你 推荐

Input

输入数据包括4个数:m,n,a,bm,n,a,b。(2m,n,a,b1002 \leq m,n,a,b \leq 100)。

Output

输出一个整数表示答案

Samples

4 4 2 2
15

Resources

2017 UESTC Training for Math