我爱占星网 我爱占星网
首页
编程
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

近期文章

  • Another kind of Fibonacci 代码写法
  • Hot girl with cool car
  • Mine sweeping 程序的问题
  • Trouble with Election! 程序设计的思路
  • Key Vertex 代码思想
  • Volume of a cylinder 容积问题
  • Roll The Cube C语言
  • Dig The Wells 程序的编写设计
  • Harmony Forever 的实现
  • Here’s a Product Which Will Make You Tensor
  • C# 使用partial关键字添加的部分类文件 变成了窗体文件 求真相
  • Decompressing in a GIF 格式问题
  • Security Center 如何输出
  • Rose Shop 输出图形
  • Assignment Tools 工具问题
  • The Flowers Floating On The YueYa Lake
  • Cover Up
  • Rain in ACStar 设计
  • 悬赏问题,缺B都来!怎么用Java语言递归方法输出99乘法表,要完整的代码
  • Java语言判断一个数字是否可同时被 2 3 5整除,定义一个函数并且调用

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华