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:

题意:

每次减数递增,求最终谁先小于0

AC代码:

 #include<bits/stdc++.h>
using namespace std; int main(){
ios::sync_with_stdio(false);
int a,b;
cin>>a>>b;
int ans=,temp=;
while(a>=&&b>=){
if(ans%==){
a-=temp;
}
else{
b-=temp;
}
temp++;
ans++;
}
if(b<){
cout<<"Valera"<<endl;
}
else{
cout<<"Vladik"<<endl;
}
return ;
}

最新文章

  1. WeakReference在Handler中的应用
  2. Python笔记(5)类__方法与继承
  3. neutron debug
  4. Dancing Links &amp; Algorithm X
  5. MySQL的mysql_insert_id和LAST_INSERT_ID(转)
  6. python3 异常处理
  7. zabbix3.0.4 部署之二 (Centos6.5系统准备)
  8. tp框架支付宝手机网页支付
  9. Cortex-M3知识点
  10. Mega的简单使用
  11. C#进行回文检测,判断字符串是否是回文的代码
  12. 如何在SpringBoot中集成JWT(JSON Web Token)鉴权
  13. Eclipse Tomcat部署web项目时出现There are no resources that can be added or removed from the server解决办法
  14. FI-盘盈盘亏借贷科目
  15. 关于陌生的依赖模块,如withStyles、react-apollo等
  16. HTTP请求中 request payload 和 formData 区别?
  17. 6-1 并行程序模拟 uva210
  18. spring整合Jersey 无法注入service的问题
  19. 第三节 java 数组
  20. ASP.NET 4.0尚未在 Web 服务器上注册

热门文章

  1. JBoss AS 7之域名直接訪问配置(The Return Of The King)
  2. iOS 使用 Core Plot 绘制统计图表入门
  3. SQL Server 中 GO 的用法(转)
  4. varnish代理缓存服务器的安装与使用
  5. 我的Java开发学习之旅------>Java语言中方法的参数传递机制
  6. 数据解析,懒加载,代理ip
  7. 4.1 《锋利的jQuery》jQuery中的事件
  8. IDA调试android so的.init_array数组
  9. 20145239杜文超 《Java程序设计》第3周学习总结
  10. ubuntu 网络配置及ssh文件传输