codeforces 811A Vladik and Courtesy

阅读 176

2022-09-07


题目网址:​​点击打开链接​​


A. Vladik and Courtesy



time limit per test



memory limit per test



input



output


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

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

don’t consider as their own. You need to know, who is the first who can’t give the right amount of candy.


Input



ab (1 ≤ a, b ≤ 109) — number of Vladik and Valera candies respectively.


Output



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:


codeforces 811A Vladik and Courtesy_#include

Illustration for second test case:


codeforces 811A Vladik and Courtesy_#include_02

很简单,模拟这个过程就行。

#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
int s=1;
while(1)
{
if(a-s<0)
{
printf("Vladik\n");break;
}
else
{
a-=s;
s++;
}
if(b-s<0)
{
printf("Valera\n");break;
}
else
{
b-=s;s++;
}
}
return 0;
}





精彩评论(0)

0 0 举报