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

31596번 - Bánh Bò 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB21141372.222%

문제

Ever since the Earth got destroyed, Trillian has been missing some Earth delicacies. Today, she had the spaceship’s food machine generate for her a Vietnamese delicacy she once enjoyed: bánh bò hấp (steamed chewy sponge cake).

Trillian has an unlimited number of bánh bò hấp pieces. Each piece of bánh bò hấp is either red or white. She wants to assemble $rc$ pieces of bánh bò hấp into a grid with dimensions $r \times c,ドル where each cell contains a single piece of bánh bò hấp. Thus, there are exactly 2ドル^{rc}$ distinct ways to assemble bánh bò hấp into an $r \times c$ grid, since we consider pieces of the same color to be identical.

We say an assembly of bánh bò hấp is uniform if all 6ドル \times 7$ subgrids have the same number of red pieces. Consequently, in a uniform bánh bò hấp assembly, all 6ドル \times 7$ subgrids have the same number of white pieces as well. Note that an $r \times c$ grid has $(r - 5)(c - 6)$ subgrids of dimensions 6ドル \times 7$.

For example, Figure D.1 illustrates a uniform assembly of 7ドル \times 8$ pieces of bánh bò hấp, where shaded cells represent red bánh bò hấp pieces and unshaded cells represent white bánh bò hấp pieces. Figure D.2 shows that all four 6ドル \times 7$ subgrids have 6ドル$ red pieces and 36ドル$ white pieces.

Figure D.1: An example of uniform bánh bò hấp assembly.

Figure D.2: All four 6ドル \times 7$ subgrids of the uniform bánh bò hấp assembly illustrated in Figure D.1.

Given $r$ and $c,ドル where $r$ is a multiple of 6ドル$ and $c$ is a multiple of 7ドル,ドル Trillian would like to calculate the number of possible uniform bánh bò hấp assemblies modulo 998ドル,円 244,円 353$.

입력

Input consists of a single line containing two integers $r$ and $c$ (6ドル ≤ r ≤ 66,円 666$; $r$ is a multiple of 6ドル$; 7ドル ≤ c ≤ 77,円 777$; $c$ is a multiple of 7ドル$).

출력

Output the number of possible uniform bánh bò hấp assemblies modulo 998ドル,円 244,円 353$.

제한

예제 입력 1

6 7

예제 출력 1

780136139

The output is 2ドル^{42}$ modulo 998ドル,円 244,円 353$.

예제 입력 2

12 14

예제 출력 2

22889737

예제 입력 3

12 42

예제 출력 3

96403614

예제 입력 4

42 14

예제 출력 4

94940316

힌트

출처

ICPC > Regionals > Asia Pacific > Asia Pacific Championship > The 2024 ICPC Asia Pacific Championship D번

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

출처

대학교 대회

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

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