Horsemeet

滴答滴答---题目链接 

Traditional games such as chess or checkers with slight modifications, are also played in Binary Casino. However, not many people play them, as these games are often referred as boring. The visitors are more attracted to more dynamic games which cause adrenaline rushes. To attract players to traditional games, your boss wants to introduce a chess-based game called Horsemeet. The rules of the game are:

The game is played by two players on a 8×88×8 chessboard. One player plays a white knight and the other player plays a black knight. The players alternate in moves, the white knight moves first. In each move a knight is moved from its current position to a random valid position. Valid position within the chessboard is a position, which is two tiles away in one coordinate and one tile away in other coordinate from the original position. All moves to a valid position are equally probable. The first knight to move to a tile already occupied by the other knight wins.

In order to check whether this game could be at least partially interesting to visitors you have to determine the probability of victory for knights at given start positions. If the probabilities of victory for both knights differs by less than 10−610−6, the outcome of such configuration is a draw.

Input

The first line of input contains two integers AA and BB (1≤A,B≤81≤A,B≤8), the start position of the white knight. The second line of each input consists of two integers CC and DD (1≤C,D≤81≤C,D≤8), the start position of the black knight. You can assume both positions are distinct.

Output

Output the knight with a higher probability of victory: "white" or "black". In case of equal probabilities output "draw".

Examples

Input

1 1
4 7

Output

white

Input

1 1
8 8

Output

black
  • 问谁先到达对方的位置
  • 若开始在同一点则draw
  • #include <stack>
    #include <cstdio>
    #include <cstring>
    #include <iostream>
    #include <algorithm>
    using namespace std;
    int main()
    {
        int n,m;
        int a,b;
        scanf("%d%d",&n,&m);
        scanf("%d%d",&a,&b);
        int l=abs(a-n);
        int r=abs(m-b);
        int ans=l+r;
        if(ans==0) printf("draw\n");
        else if(ans%2!=0)
            printf("white\n");
        else if(ans%2==0)
            printf("black\n");
        return 0;
    }

     

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值