CF73A.The Elder Trolls IV: Oblivon
普及/提高-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Vasya plays The Elder Trolls IV: Oblivon. Oh, those creators of computer games! What they do not come up with! Absolutely unique monsters have been added to the The Elder Trolls IV: Oblivon. One of these monsters is Unkillable Slug. Why it is "Unkillable"? Firstly, because it can be killed with cutting weapon only, so lovers of two-handed amber hammers should find suitable knife themselves. Secondly, it is necessary to make so many cutting strokes to Unkillable Slug. Extremely many. Too many!
Vasya has already promoted his character to 80-th level and in order to gain level 81 he was asked to kill Unkillable Slug. The monster has a very interesting shape. It looks like a rectangular parallelepiped with size x × y × z, consisting of undestructable cells 1 × 1 × 1. At one stroke Vasya can cut the Slug along an imaginary grid, i.e. cut with a plane parallel to one of the parallelepiped side. Monster dies when amount of parts it is divided reaches some critical value.
All parts of monster do not fall after each cut, they remains exactly on its places. I. e. Vasya can cut several parts with one cut.
Vasya wants to know what the maximum number of pieces he can cut the Unkillable Slug into striking him at most k times.
Vasya's character uses absolutely thin sword with infinite length.
瓦西娅正在玩《上古卷轴:湮灭》(The Elder Trolls IV: Oblivon)。哦,这些电脑游戏的开发者啊!他们究竟想出了些什么!《上古卷轴:湮灭》中加入了绝对独一无二的怪物。其中一种怪物便是“不死鼻涕虫”(Unkillable Slug)。它为何被称为“不死”?首先,它只能被切割类武器杀死,因此那些钟爱双手琥珀锤的玩家得自己去找一把合适的刀;其次,要杀死这只“不死鼻涕虫”,必须对其施加极其大量的切割次数——多到令人难以置信!
瓦西娅已将自己的角色升至 80 级,而为了升到 81 级,他被要求击杀这只“不死鼻涕虫”。该怪物具有非常有趣的形状:它是一个尺寸为 x×y×z 的长方体(即矩形平行六面体),由不可摧毁的 1×1×1 小立方体单元构成。每次攻击,瓦西娅可沿一个假想的网格对鼻涕虫进行一次切割,即用一个平行于长方体某一面的平面进行切割。当怪物被分割成的部分总数达到某个临界值时,它便会死亡。
每次切割后,怪物的所有部分不会掉落,而是仍保持在原位不动。也就是说,瓦西娅一次切割可以同时切过多个部分。
瓦西娅想知道:在最多进行 k 次攻击的前提下,他最多能将这只“不死鼻涕虫”切成多少块?
瓦西娅的角色使用一把绝对薄且无限长的剑。
输入格式
The first line of input contains four integer numbers x, y, z, k (1 ≤ x, y, z ≤ 106, 0 ≤ k ≤ 109).
输入的第一行包含四个整数 x、y、z、k(1≤x,y,z≤106,0≤k≤109)。
输出格式
Output the only number — the answer for the problem.
Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preffered to use cout (also you may use %I64d).
输出唯一的数字——该问题的答案。
请注意,在 C++ 中读取或写入 64 位整数时,请勿使用 %lld 格式说明符。推荐使用 cout(您也可以使用 %I64d)。
输入输出样例
输入#1
2 2 2 3
输出#1
8
输入#2
2 2 2 1
输出#2
2
说明/提示
In the first sample Vasya make 3 pairwise perpendicular cuts. He cuts monster on two parts with the first cut, then he divides each part on two with the second cut, and finally he divides each of the 4 parts on two.
在第一个样例中,瓦西娅进行了 3 次两两互相垂直的切割。他通过第一次切割将怪物分为两部分,然后通过第二次切割将每一部分再各分为两部分,最后通过第三次切割将得到的 4 部分各自再分为两部分。
输入解题思路,AI测评打分。不知道怎么写?