Logo
(追記) (追記ここまで)

14202번 - Minions and the rooms 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB37151555.556%

문제

N minions live in the basement of Gru’s house and are numbered from 1 to N. There are M rooms with infinite capacity in the basement and each room has two states: available or unavailable. Gru will reverse the state of consecutive rooms every day. Minions can only live in available rooms. And each available room should contain at least one Minion.

Gru is interested in how many different ways to arrange creatures in rooms. At the beginning, all rooms are available. In the following D days, Gru will ask you the number of ways after reversing. Two ways A and B are regarded as the same if for any room in A, there exists a room in B that the creatures in these two rooms have the same set of numbers. In other words, rooms are indistinguishable.

입력

The first line of the input contains an integer T (T ≤ 10), indicating the number of cases. For each test case:

The first line: three space separated integers N, M and D (1 ≤ M ≤ N,D ≤ 100000). Their meanings are described above.

The following D lines: two space separated integers L and R (1 ≤ L ≤ R ≤ M) denoting the consecutive rooms L, L + 1, ..., R which are reversed by the Gru on that day.

출력

For each query, output the number of different ways to arrange minions modulo 880803841 as it can be very large.

제한

예제 입력 1

2
3 3 2
2 2
1 3
5 5 3
1 3
2 2
1 5

예제 출력 1

3
1
15
25
15

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > Iran Internet Programming Contest > IIPC 2016 I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /