10556: T368993 「QFOI R1」抱抱
内存限制:128 MB
时间限制:1.000 S
提交:2
解决:1
评测方式:文本比较
命题人:
题目描述
小 R 是一个可爱的女孩子,她希望跟大家抱抱,顺便给大家分蛋糕吃。
蛋糕是一个大小为 的长方体,其中每个单位正方体都被赋予了一个坐标 ()。
共进行 次切蛋糕操作,每次按如下三种方式之一切分:
- 切出 的部分分给大家。
- 切出 的部分分给大家。
- 切出 的部分分给大家。
由于她自己也想吃蛋糕,她希望知道在每次切蛋糕后,还剩下多少体积没有分给大家。
输出
输入格式
inkMacSystemFont, "font-size:16px;white-space:normal;background-color:#FFFFFF;">第一行四个整数 ,表示蛋糕的大小和切蛋糕次数。
接下来 行,每行两个整数 ,表示进行【题目描述】中的第 种操作,参数为 。
输出格式
inkMacSystemFont, "font-size:16px;white-space:normal;background-color:#FFFFFF;">行,每行一个整数,表示剩余部分体积。
样例输入 复制
3 3 3 2
1 2
2 1
样例输出 复制
9
6
提示
说明/提示
inkMacSystemFont, "font-size:16px;white-space:normal;background-color:#FFFFFF;">样例 解释
第一次切蛋糕,将所有 的部分切掉,剩余的单位正方体有 共 个。
第二次切蛋糕,将所有 的部分切掉,剩余的单位正方体有 共 个。
样例 解释
第四次切蛋糕没有任何作用,因为第二次切蛋糕时 的部分已经被切掉,此时已经不存在 的单位正方体。
注意每次操作中的参数 是初始时决定的绝对坐标,不会随着操作的进行而改变。
数据范围
本题共 个测试点,每个测试点 分。
对于全部数据,保证 ,,,若 则 ,若 则 ,若 则 。
- 对于测试点 :保证 。
- 对于测试点 :保证 ,。
- 对于测试点 :保证 ,。
- 对于测试点 :无特殊限制。