编程介的小学生 2017-12-04 15:39 采纳率: 20.5%
浏览 604
已采纳

FunnyXEN

Problem Description
For any positive integer n, we define function F(n) and XEN(n).

For a collection S(n)={1,2,...,2n}, we select some numbers from it. For a selection, if each selected number could not be divided exactly by any other number in this selection, we will call the selection good selection. Further, we call a good selection best selection if the selection has more elements than any other good selection from S(n). We define F(n) the number of elements in the best selection from S(n). For example, n=2, F(n)=2. From the collection {1,2,3,4}, we can make good selection just like {2,3} or {3,4}, but we can't make any larger selection. So F(2) = 2.

Then we pay attention to XEN(n). For every S(n), there are always some numbers could not be selected to make up any best selection. For instance, when n=2, 1 is always could not be chosen. What's more, for every S(n), there is a number k which satisfies that all the number, from 0 to k, are always could not be chosen. Now we let XEN(n)=k:

n=2, F(n)=2, XEN(2)=1;
n=4, F(n)=4, XEN(4)=1.

You should write a program to calculate the value of F(n) and XEN(n) with a given number n.

Input
Your program is to read from standard input.

There are multiple cases. For each case, one integer n (1 ≤ n ≤ 10^7) in a line.

Output
Output two integers with one space between them in one line per case.

Sample Input
2
4

Sample Output
2 1
4 1

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-12-09 16:07
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算