Mod Inverse
시간 제한: 1000ms메모리 제한: 128MB출처: CCC 2001 JuniorBOJ 6930
문제
In many cryptographic applications, the Modular Inverse is a key point. This question involves finding the modular inverse of a number.
Given , where and are integers, the modular inverse of is the unique integer , , such that the remainder upon dividing by is .
For example, , so the remainder when is divided by is , and thus is the inverse of modulo .
You are to write a program which accepts as input the two integers and , and outputs either the modular inverse , or the statement No such integer exists. if there is no such integer .
예제
예제 1
입력
4 17
출력
13
예제 2
입력
6 10
출력
No such integer exists.
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.