我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Description has only two Sentences

Problem Description
an = X*an-1 + Y and Y mod (X-1) = 0.
Your task is to calculate the smallest positive integer k that ak mod a0 = 0.

Input
Each line will contain only three integers X, Y, a0 ( 1 < X < 231, 0 <= Y < 263, 0 < a0 < 231).

Output
For each case, output the answer in one line, if there is no such k, output "Impossible!".

Sample Input
2 0 9

Sample Output
1

近期文章

  • Roll The Cube 的代码怎么编写
  • Volume of a cylinder C语言实现
  • Dig The Wells 水井挖掘
  • LCIS 的一个实现的方式
  • Seashells 程序作法
  • Key Vertex 怎么来实现的
  • Trouble with Election! 程序的实现
  • My Brute 具体的实现
  • Mine sweeping 扫雷的问题
  • Hot girl with cool car 怎么来编写呢
  • Assignment Tools C程序的设计
  • Catch The Heart 的程序的设计
  • openGL 图形的问题
  • The Flowers Floating On The YueYa Lake
  • The Beijing-Hangzhou Grand Canal C语言
  • Arithmetically Challenged 的程序的编写
  • Decompressing in a GIF 压缩问题
  • Flipper 的程序的设计
  • The Flood 的编写设计
  • Here’s a Product Which Will Make You Tensor

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华