Given an integer xx, find 2 integers aa and bb such that:

1≤a,b≤x1≤a,b≤x
bb divides aa (aa is divisible by bb).
a⋅b>xa⋅b>x.
ab<xab<x.
Input
The only line contains the integer xx (1≤x≤100)(1≤x≤100).

Output
You should output two integers aa and bb, satisfying the given conditions, separated by a space. If no pair of integers satisfy the conditions above, print “-1” (without quotes).

Examples
Input
10
Output
6 3
Input
1
Output
-1

直接暴力不多说
代码如下:

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;int n;int main()
{while(scanf("%d",&n)!=EOF){int flag=0;for(int i=1;i<=n;i++){for(int j=1;j<=n;j++){if(i%j==0&&i*j>n&&i/j<n){printf("%d %d\n",i,j);flag=1;break;}}if (flag==1) break;}if(flag) continue;else cout<<"-1"<<endl;}
}

努力加油a啊,(o)/~

Ehab and another construction problem(水题)相关推荐

  1. hdu-5867 Water problem(水题)

    题目链接: Water problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Othe ...

  2. Poj1207 The 3n + 1 problem(水题(数据)+陷阱)

    一.Description Problems in Computer Science are often classified as belonging to a certain class of p ...

  3. Codeforces Round #360 (Div. 2) C. NP-Hard Problem 水题

    C. NP-Hard Problem 题目连接: http://www.codeforces.com/contest/688/problem/C Description Recently, Pari ...

  4. 2020牛客多校第3场:[Points Construction Problem + 思维题+构造]

    题目链接 题目大意:就是给你n个边长为1的正方形,要求用这些正方形拼成周长为m的图形,并输出这些正方形的坐标,如果没有输出No 首先如果这些正方形都零散分布那么周长就是4∗n4*n4∗n,如果将这些正 ...

  5. HDU - 1757 A Simple Math Problem(矩阵快速幂,水题)

    题目链接:点击查看 题目大意:实现公式: f(x)=x,x<10 f(x)=a0*f(x-1)+a1*f(x-2)+--+a9*f(x-10) 题目给出a0~a9,一个n和一个m,要求输出f(n ...

  6. 水题/poj 1852 Ants

    1 /* 2 PROBLEM:poj1852 3 AUTHER:Nicole 4 MEMO:水题 5 */ 6 #include<cstdio> 7 using namespace std ...

  7. hdu 2041:超级楼梯(水题,递归)

    超级楼梯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submissio ...

  8. HDU2568 前进【水题】

    前进 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submiss ...

  9. CF Round #426 (Div. 2) The Useless Toy 思维 水题

    题目链接: http://codeforces.com/contest/834/problem/A 题目描述: 输入起始状态和结束状态和数列长度, 判断旋转方向是顺时针逆时针还是不合理 解题思路: 长 ...

最新文章

  1. mysql数据库什么是事件_MySQL数据库之mysql 事件(Event) 总结
  2. sparkstreaming直接从kafka消费数据
  3. vue-cli3 本地代理配置
  4. 代理缓存服务器squid
  5. 【JEECG技术文档】Redis与Eache切换文档
  6. mysql 不在另一个表中_MySQL选择查询从表中选择不在另一个表中的行?
  7. 数学教授曲安京2016年毕业致辞:永远珍重那些美好的内蕴品质
  8. 一道和逆向和溢出有关的竞赛题分析
  9. 如何高效的使用Google
  10. C语言实现strcmp函数
  11. 神器vimium:比同级程序员成长更快,我主要靠它
  12. 格子广告+php,GitHub - liujijun95/easy-amazon-advertising: 基于 amazon advertising v2 接口的 PHP 广告信息组件...
  13. JSF 原理简要介绍
  14. ERROR 1370 (42000): execute command denied to user ‘james‘@‘localhost‘ for routine ‘test.coun_add‘
  15. mipi传输距离3米_蓝牙网关有效传输距离是多少?
  16. js escape()_unescape().html
  17. github代码clone加速
  18. 计算机程序设计员(java三级)应注意什么?
  19. 游族网络xStarRocks:高效助力数据查询,灵活应对多维分析
  20. CNNs 入门论文汇总

热门文章

  1. uniapp底部弹出框效果
  2. 微信小程序实现分类菜单 swiper分类菜单
  3. php优先级,PHP运算优先级——神一般的设定
  4. php返回mysql错误语句_[已解决]php查询mysql返回了错误的结果
  5. gazebo入门_Gazebo仿真控制中,有哪些你不知道的秘密?
  6. matlab根据url链接下载*.tar文件并解压
  7. 福建信息技术学院计算机系男生宿舍怎么样,广西职业技术学院宿舍怎么样
  8. EditText获取焦点并自动弹出软键盘
  9. html5嵌套css语言,HTML5和CSS3
  10. mysql 修复错误连接_mysql 无法连接问题的定位和修复过程分享