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

6930번 - Mod Inverse 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB25819917376.889%

문제

In many cryptographic applications, the Modular Inverse is a key point. This question involves finding the modular inverse of a number.

Given 0ドル < x < m,ドル where $x$ and $m$ are integers, the modular inverse of $x$ is the unique integer $n,ドル 0ドル < n < m,ドル such that the remainder upon dividing $x \times n$ by $m$ is 1ドル$.

For example, 4ドル \times 13 = 52 = 17 \times 3 + 1,ドル so the remainder when 52ドル$ is divided by 17ドル$ is 1ドル,ドル and thus 13ドル$ is the inverse of 4ドル$ modulo 17ドル$.

You are to write a program which accepts as input the two integers $x$ and $m,ドル and outputs either the modular inverse $n,ドル or the statement No such integer exists. if there is no such integer $n$.

입력

출력

제한

  • $m \le 100$

예제 입력 1

4
17

예제 출력 1

13

예제 입력 2

6
10

예제 출력 2

No such integer exists.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2001 > CCC 2001 Junior Division 2번

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

출처

대학교 대회

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

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