午夜视频在线网站,日韩视频精品在线,中文字幕精品一区二区三区在线,在线播放精品,1024你懂我懂的旧版人,欧美日韩一级黄色片,一区二区三区在线观看视频

分享

Deja vu of … Go Players

 印度阿三17 2019-10-06

An ordinary sequence rather than magic codes? Rikka's opinion is much more important than the "truth" itself. She soon felt sleepy and fell asleep to take a trip to dreamlands in passing.

Rikka found two elders playing Go game when her sanity got back. The ethereal clouds, hardy vigorous pines, and rugged rocks shocked her. A fiction?isekai! Excited Rikka's eyes ran around and around and focused on the Go chessboard in the end.

She found that the two players, wearing white and red respectively, were not playing Go game — they divided the black and white chess pieces into some piles, and were taking turns removing them. They kept silent for her questions, so Rikka had to stand there and keep her eyes on the chessboard.

They seemed to be playing an unexpectedly simple game. The red player has?nn?black piles and its opponent has?mm?white piles at the beginning. They take turns removing any positive number of chess pieces from arbitrary one of their assigned piles. Red goes first, and the player who first removes all chess pieces assigned to oneself "wins", and the other player has to drink.

Drinking is illegal for minors in Japan, so Rikka wonders if she can ensure to win when she is the red player.

Input

The first line contains an integer?T?(1≤T≤100)T?(1≤T≤100), the number of test cases. Then?TTtest cases follow.

The input format of each test case is as follows:

The first line contains two integers?n,m?(1≤n,m≤100)n,m?(1≤n,m≤100), the numbers of piles of the red and the white player, respectively.

The following line contains?nn?integers?ai?(1≤ai≤109)ai?(1≤ai≤109), in which each integer indicates the number of pieces in a black pile of the red player.

The following line contains?mm?integers?bi?(1≤bi≤109)bi?(1≤bi≤109), in which each integer indicates the number of pieces in a white pile of the white player.

Output

Output a string in the only line, "Yes" if the red player who moves first can ensure to win, or "No" otherwise, without quotation marks.

Example

Input
2
3 2
1 1 1
2 2
1 1
4
3
Output
No
Yes

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
typedef long long lli;
using namespace std;
multiset<int> mu;
    #define fi      first
    #define se      second
    #define pb      push_back
    #define pql     priority_queue<lli>
    #define pq      priority_queue<int>
    #define ok      return 0;
    #define oi(x)   cout<<x<<endl;
    #define os(str) cout<<string(str)<<endl;
using namespace std;
//multiset<int> :: iterator it ;
//int dir[6][3] = {0,0,1,0,0,-1,1,0,0,-1,0,0,0,1,0,0,-1,0};           //三維六向
//int dir[8][2] = {2,1,2,-1,-2,1,-2,-1,1,2,1,-2,-1,2,-1,-2};          //馬走日
//int dir[4][2] = {1,0,-1,0,0,1,0,-1};                                //二維四向
//int dir[8][2]={1,0,1,1,1,-1,-1,0,-1,1,-1,-1,0,1,0,-1};              //全方位
#define en(xx) xx.begin(),xx.end()
#define rep(j,k) for (int i = j;   i < k;  i  )
#define per(j,k) for (int i = j-1; i >= k; i--)
  typedef pair < int, int > pii;
  typedef pair < lli, lli > pll;
  typedef vector < lli > vl;
  typedef vector < int > vi;
#define TLE std::ios::sync_with_stdio(false);   cin.tie(NULL);   cout.tie(NULL);   cout.precision(10);
const int mxn = 2e5   10;
lli t,n,l,r,cnt,k,a[mxn],c[mxn],m;
int main()
{
    cin>>t;
    while(t--)
    {
        cin>>n>>m;for(int i=0;i<n;i  )
            cin>>k;
        for(int i=0;i<m;i  )
            cin>>k;
        if(n<=m)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
    }
}

?

來源:https://www./content-4-490151.html

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多