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

http://www.cnblogs.com/liyinggang/p/5535925.html

近期文章

  • 定义一个一维数组长度为4,将所有的水仙花数保存到这个数组中
  • 输入一个整数,打印其和大于10的所有整数
  • 怎样设置指定的域名,访问指定的网站链接
  • 求助!MATLAB Application Compiler?
  • 求大神,求大神,求大神,求大神,spring配置多租户错误,去掉多租户配置不报错。
  • 想在jsp界面中导入Raty插件,然而总是报错
  • Exchange Rates
  • JavaWeb开发使用的IDE
  • 关于maven到包问题……
  • Sea Sky
  • Oracle 添加日志记录信息
  • 商品的价格变动,怎么建立快照
  • eclipse gIt clone 404,用git 客户端正常
  • springmvc 时间属性是如何跟简单java类绑定的?
  • git在window上怎么安装
  • 关于nodejs express框架的cookie问题
  • if(a%2) i++;这个语句是不是只有a%2有余数的时候i才会++?
  • Java支持断点下载文件
  • 怎么将orcal数据库生成的数据脚本导入到sqlserver里
  • 数据结构与算法之骑士遍历

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华