아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Restrooms

시간 제한2초메모리 제한1024 MB

요약
각 구간에 여자 화장실이 하나 이상, 또는 남자 화장실이 하나 이상 있어야 한다는 요청이 주어질 때, n개의 화장실에 성별을 배정하는 방법이 있는지 판정하고 하나를 출력한다.
난이도

보통10점 중 7점

유형
그리디, 구간, 정렬, 구현
정답자
아직 제출이 없습니다

문제

MIPT university administration is planning to make repairs in the main corridor. Above all, they are going to repair all nn restrooms located along the corridor and numbered from 11 to nn. Initiative group of MIPT students and professors has made several requests of the following types:

  • There should be at least one women's restroom in the segment between l_ithl\_i^{th} to r_ithr\_i^{th} restroom inclusive.
  • There should be at least one men's restroom in the segment between l_ithl\_i^{th} to r_ithr\_i^{th} restroom inclusive.

You should answer if it is possible to satisfy all these requests, and, in case it is possible, output any possible arrangement.

입력

In the first line you are given three integers n,w,mn, w, m (1≤n≤1061\le n\le 10^6, 0≤w,m≤1060\le w, m \le 10^6) --- number of restrooms, number of requests for women's restroom, number of requests for men's restroom respectively.

In the next w+mw+m lines you are given descriptions of requests, first about women's restrooms, then about men's restrooms. Description of one request consists of two integers l_i,r_il\_i, r\_i (1≤l_i≤r_i≤n1\le l\_i \le r\_i \le n).

출력

In the first line output string <<Yes>> (without quotes), if the way to satisfy all requests exists and <<No>> (without quotes), if it is impossible. If answer is yes, then output in the second line string consisting of nn zeros and ones, describing possible way of assigning restrooms to be men's (1) and women's (0).

예제3

  1. 예제 1

    입력
    3 1 1
    1 1
    3 3
    
    예상 출력
    Yes
    001
    
  2. 예제 2

    입력
    3 1 1
    1 1
    1 1
    
    예상 출력
    No
    
  3. 예제 3

    입력
    1 3 0
    1 1
    1 1
    1 1
    
    예상 출력
    Yes
    0