A. Vladik and Courtesy
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

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 ab (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.

Examples
input
1 1
output
Valera
input
7 6
output
Vladik
Note

Illustration for first test case:

Illustration for second test case:

【题意】:看hint就懂了。

【分析】:根据天数的奇偶区分谁做东(减改天数)

【代码】:

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define N 65535+10
int main()
{
ll a,b;
while(cin>>a>>b)
{
for(int i=1;i<=10000007;i++)
{
if(i%2==1)
{
a -= i;
if(a<0) return 0*puts("Vladik");
}
else
{
b -= i;
if(b<0) return 0*puts("Valera");
}
}
}
}

  

最新文章

  1. Docker学习笔记
  2. 如何使用QQ号进行快捷登录
  3. 用UWP实现一个和win10设置页面类似的布局
  4. linux配置ssh互信
  5. [LeetCode]题解(python):032-Longest Valid Parentheses
  6. Annotation介绍@interface
  7. wampserver php 设置时间
  8. Mysql 启动遇到 The server quit without updating PID file (/[FAILED]l/mysql/data/021rjsh216086s.pid)和Attempted to open a previously opened tablespace
  9. vs2013中集成Git
  10. 20165231 2017-2018-2 《Java程序设计》第9周学习总结
  11. Python class NameError name &quot;xxx&quot; is not defined
  12. SharePoint PowerShell 启动工作流
  13. Ubuntu 安装google chrome
  14. tomcat 配置域名访问应用
  15. MODULE_DEVICE_TABLE 的作用
  16. mongodb之oplog
  17. PHP 博客收集
  18. POJ 2229 Sumsets(技巧题, 背包变形)
  19. js及Java中对于两个时间日期的判断脚本
  20. Shell基础学习(四) echo命令

热门文章

  1. dom4j处理带命名空间的XML-使用XPath(转)
  2. str_replace函数的使用规则和案例详解
  3. Tuxera ntfs软件如何删除干净
  4. myeclipse 配置resin
  5. 【DM642学习笔记六】TI参考文档--DM642 Video Port Mini Driver
  6. Pandas怎样按条件删除行?
  7. Python爬虫笔记【一】模拟用户访问之Tesseract-ocr验证码训练(5)
  8. WPF 禁用中文
  9. Java爬虫的实现
  10. KOA 学习(四)