8593: Board Game

内存限制:256 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

One day, NIO plays an interesting board game with his four-year-old sister, Yasa. This board game is a confrontation game, that players are divided into the good camp and the evil camp. The good camp has n cards, each card represents a soldier. The evil camp has a mage and a magic crystal, the magic crystal provides the mage with the magic energy to attack. Before the fight, the n soldiers need to be divided into m groups. Each action turn, the soldiers attack the magic crystal. Each living soldier can cause one unit of damage, and the durability of the attacked magic crystal is reduced by one unit. After the good camp's action is over, the evil camp takes its action and the mage can release a spell that kills at most k soldiers in a group. If all soldiers die, then the battle is over. 

NIO is on the evil side and his sister is on the good side. NIO is clever and will always cast spells in the best way so that he himself will be attacked less. Yasa asks you for help. Assuming that the magic crystal has a total of x mana points, and it will be destroyed if the mana points becomes to 0. She wants to know if she can defeat the evil camp if she got an optimal group dividing method.

输入格式

The only line contains four integers  n,m,k.
1≤n≤109,1≤x≤1013,1≤m,k≤107

输出格式

Output "YES", if Yasa can win the game. Followed by a number indicating the maximum damage Yasa can cause on the magic crystal (it can greatly exceed the amount of the magic crystal's durability).
Otherwise output "NO".

输入样例 复制

10 4 4 5

输出样例 复制

YES 23

数据范围与提示

The output number can be very big.