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

17315번 - Matrix Game 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB130501230.000%

문제

TingTing is a girl that loves matrices. One day, she wants to use a computer to generate a giant n row by m column matrix (you don't have to worry about how she'll store it). Her generated matrix will satisfy a mystical property: if we use F[i][j] to represent the cell in the i-th row and j-th column, then F[i][j] will satisfy the following system of equations:

where a, b, c, and d are given constants.

TingTing would like to know the value of F[n][m] and she would like you to help her. Since the final value may be very large, you are only required to output it modulo 1,000,000,007.

입력

The input will contain the six integers n, m, a, b, c, and d.

출력

Output a single integer, the value of F[i][j] modulo 1,000,000,007.

제한

  • 1 ≤ n, m ≤ 101,000,000
  • 1 ≤ a, b, c, d ≤ 109

예제 입력 1

3 4 1 3 2 6

예제 출력 1

85

힌트

출처

Olympiad > National Olympiad in Informatics (China) > NOI 2013 4번

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

출처

대학교 대회

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

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