C. Adidas vs adivon

Source: Internet
Author: User
C. Adidas vs adivon Time limit:1000 ms Case time limit:1000 ms Memory limit:65536kb64-bit integer Io format: % LLD Java class name: mainsubmit status PID: 29378 font size: +  -

"We sat on the top of the pile and listened to our mother's story about the king. I was born in a very ordinary family, and my mother was able to predict. When I was a child, my mother often told me: 'In the future world, there is something called the King of Kings that is more important than oil and gold ...... 'At that time, I listened with a head-on, and it was just midnight, so I heard that I was fascinated and let my nose flow into my own mouth. When I grow up, I finally know what King is. It is more important to hundreds of millions of people than their own lives ......"

As far as I know, the daily maintenance costs of a pair of ordinary King's leather shoes are amazing. Some billionaires have declared their personal bankruptcy after purchasing King's products because they are overwhelmed by the daily maintenance costs of the products.

"I'm coming !!!"

However, Adidas, a brand that has never been heard of, has sued adivon for trademark infringement !! This is intolerable for adivon fans !!! So on a dark night, a noble adivon fan and another Adidas are about to compete in the mountains of China. As new young people in the 21st century, they chose intellectual confrontation to win or lose in a game.

They took out a piece of paper with positive integers in length and width. Each time, the current party can choose to split the paper horizontally or vertically into two equal halves (parallel to the long side or wide side) and discard the half. However, the length and width of the remaining part are still positive integers. If one party cannot be torn up, the party will lose the game.

Adivon fans are very generous, so every time they are Adidas first.

Input

The first line is an integer N (2 <= n <= 2000), indicating how many game games they have played.

In the next n rows, each row contains two positive integers, L and H (1 <= L, H <= 1000000), indicating the initial length and width of the paper.

Output

For each game, one line is output. If the adivon Fans win, "adivon prevails" is output. Otherwise, the adivon fans will launch the magic to change the game ending. In this case, "Adidas loses" is output ".

Sample Input
21 22 2
Sample output
Adidas losesAdivon prevails
#include<stdio.h>int main(){    int n,a,b,k;    scanf("%d",&n);    while(n--)    {        scanf("%d%d",&a,&b);        k=0;        while(a%2==0)        {            k++; a/=2;        }        while(b%2==0)        {            k++; b/=2;        }        if(k%2==0)printf("Adivon prevails\n");        else printf("Adidas loses\n");    }}


C. Adidas vs adivon

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.