| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 535 人关注过本帖
标题:正在进行的ICPC的题目(NO.E)
只看楼主 加入收藏
蓝色神话
Rank: 2
等 级:论坛游民
威 望:1
帖 子:404
专家分:24
注 册:2006-5-11
收藏
 问题点数:0 回复次数:0 
正在进行的ICPC的题目(NO.E)

Find the largest LCM
Time Limit:4S Memory Limit:5120K


Description
I believe that most of you know how to split a positive integer N into the sum of several positive integers, such that their product is the biggest. We only shall try best to split N into the sum of multiple 3.
Then, how about splitting N such that their Least Common Multiplier (LCM) is the biggest?


Input
Input contains several test cases.
Each case has only one line, consisting of two positive integers, N and M. (0 < N <= 3000, 0 < M <= 10000)
The last case is followed by a line containing two zeros.


Output
The output for each case contains the biggest LCM's mod M.

Sample Input


6 23
6 23
0 0


Sample Output


Case 1: 6
Case 2: 6

谁能解决?

搜索更多相关主题的帖子: ICPC 
2006-10-07 14:12
快速回复:正在进行的ICPC的题目(NO.E)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.065909 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved