A. Fake NP
来源:互联网 发布:西安网络推广价格 编辑:程序博客网 时间:2024/05/18 00:13
A. Fake NP
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Tavak and Seyyed are good friends. Seyyed is very funny and he told Tavak to solve the following problem instead of longest-path.
You are given l and r. For all integers from l to r, inclusive, we wrote down all of their integer divisors except 1. Find the integer that we wrote down the maximum number of times.
Solve the problem to show that it’s not a NP problem.
Input
The first line contains two integers l and r (2 ≤ l ≤ r ≤ 109).
Output
Print single integer, the integer that appears maximum number of times in the divisors.
If there are multiple answers, print any of them.
Examples
input
19 29
output
2
input
3 6
output
3
Note
Definition of a divisor: https://www.mathsisfun.com/definitions/divisor-of-an-integer-.html
The first example: from 19 to 29 these numbers are divisible by 2: {20, 22, 24, 26, 28}.
The second example: from 3 to 6 these numbers are divisible by 3: {3, 6}.
#include<iostream>#include<cstring>#include<string>#include<cstdio>#include<algorithm>using namespace std;int main(){ long long int x, y, t; while (cin >> x >> y) { t = y - x; if (t) cout << "2" << endl; else cout << x << endl; } return 0;}
- Codeforces805 A. Fake NP
- CF411div2 A. Fake NP
- A. Fake NP
- A. Fake NP
- 805A Fake NP
- CodeForces 805A Fake NP
- CodeFroces 805A Fake NP
- Codeforces 805A Fake NP
- CF#805 A. Fake NP(水题)
- Codeforces Round #411 (Div. 2) A. Fake NP
- Codeforces Round #411 A.Fake NP (思维题)
- Codeforces Round #411 (Div. 2) A. Fake NP【水题】
- 小白题解 Codeforces 805A Fake NP
- Fake NP (Codeforces
- codeforces 411div2-fake NP
- Codeforces Round #411 A.Fake NP【数论有关因数结论+经验】
- Codeforces Round #411(A. Fake NP; B. 3-palindrome; C. Find Amir; D.Minimum number of steps)
- setup a fake ap with backtrack5
- 暴力求解数独
- windows下spark2.1源码编译及修改
- 解决有道for mac 无法屏幕取词
- 教你上传本地代码到github
- 【NOIP2010初赛】【斜率优化】【DP】烽火传递 题解
- A. Fake NP
- Js 深拷贝,很好理解的方式之一
- 指示函数(indicator function) 的作用
- python2.7 爬虫中文显示错误
- ASP.NET MVC开发(0)
- 卷积神经网络CNN_综述一
- 域控制器
- 一个Python程序员的进化史
- PL/SQL Developer如何连接64位的Oracle图解