A. Vladik and Courtesy(思维题)
发布日期:2021-10-16 05:05:02 浏览次数:10 分类:技术文章

本文共 1290 字,大约阅读时间需要 4 分钟。

At regular competition Vladik and Valera won a and b candies respectively. Vladik offered 1 his candy to Valera. After that Valera gave Vladik 2 his candies, so that no one thought that he was less generous. Vladik for same reason gave 3 candies to Valera in next turn.

More formally, the guys take turns giving each other one candy more than they received in the previous turn.

This continued until the moment when one of them couldn’t give the right amount of candy. Candies, which guys got from each other, they don’t consider as their own. You need to know, who is the first who can’t give the right amount of candy.

Input

Single line of input data contains two space-separated integers a, b (1 ≤ a, b ≤ 109) — number of Vladik and Valera candies respectively.

Output

Pring a single line "Vladik’’ in case, if Vladik first who can’t give right amount of candy, or "Valera’’ otherwise.

Example
Input
1 1
Output
Valera
Input
7 6
Output
Vladik
Note

Illustration for first test case:

Illustration for second test case:

题意:

很水的题目,注意的是别人给的不能算自己的。

代码:

#include 
#include
#include
using namespace std;int main(){ int a,b,i; while(cin>>a>>b) { for(i=1;;i++) { if(i%2==0) { b=b-i; if(b<0){cout<<"Valera"<

转载地址:https://blog.csdn.net/sinat_37668729/article/details/76919262 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:B - Vladik and Complicated Book(思维题)
下一篇:哈密尔顿环

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2024年04月07日 03时55分09秒