HDU 5924 Mr. Frog’s Problem
来源:互联网 发布:成都大数据协会 编辑:程序博客网 时间:2024/06/05 12:04
Mr. Frog’s Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1504 Accepted Submission(s): 869
Problem Description
One day, you, a clever boy, feel bored in your math class, and then fall asleep without your control. In your dream, you meet Mr. Frog, an elder man. He has a problem for you.
He gives you two positive integers A and B, and your task is to find all pairs of integers (C, D), such thatA≤C≤B,A≤D≤B and AB+BA≤CD+DC
He gives you two positive integers A and B, and your task is to find all pairs of integers (C, D), such that
Input
first line contains only one integer T (T≤125 ), which indicates the number of test cases. Each test case contains two integers A and B (1≤A≤B≤1018 ).
Output
For each test case, first output one line "Case #x:", where x is the case number (starting from 1).
Then in a new line, print an integer s indicating the number of pairs you find.
In each of the following s lines, print a pair of integers C and D. pairs should be sorted by C, and then by D in ascending order.
Then in a new line, print an integer s indicating the number of pairs you find.
In each of the following s lines, print a pair of integers C and D. pairs should be sorted by C, and then by D in ascending order.
Sample Input
210 109 27
Sample Output
Case #1:110 10Case #2:29 2727 9
Source
2016CCPC东北地区大学生程序设计竞赛 - 重现赛
这里有证明:点击打开链接
#include<iostream>using namespace std;typedef long long ll;int main(){int t;cin>>t;for(int i=1;i<=t;i++){ll a,b;cin>>a>>b;printf("Case #%d:\n",i);if(a==b){cout<<1<<endl;cout<<a<<' '<<b<<endl;}else{cout<<2<<endl;cout<<a<<' '<<b<<endl;cout<<b<<' '<<a<<endl;}}}
阅读全文
0 0
- HDU 5924 Mr. Frog’s Problem【规律】
- hdu 5924/Mr. Frog’s Problem
- hdu 5924 Mr. Frog’s Problem
- hdu 5924 Mr. Frog’s Problem【水题】
- HDU 5924 Mr. Frog’s Problem
- HDU 5924-Mr. Frog’s Problem
- HDU 5924 Mr. Frog’s Problem
- hdu-5924-Mr. Frog’s Problem
- HDU 5924 Mr. Frog’s Problem
- HDU 5924Mr. Frog’s Problem
- Mr. Frog’s Problem HDU
- HDU-5924:Mr. Frog’s Problem(不等式变换)
- HDU5924-Mr. Frog’s Problem
- Mr. Frog’s Problem C
- HDU 5924 Mr. Frog’s Problem 【模拟】 (2016CCPC东北地区大学生程序设计竞赛)
- Mr. Frog’s Problem 水题,打表
- hdu 5924 Mr. Frog’s Problem(2016CCPC东北地区大学生程序设计竞赛 C题,数学思维)
- (HDU 5924)Mr. Frog’s Problem 思维水题 <2016CCPC东北地区大学生程序设计竞赛 - 重现赛 >
- adb命令行保存logcat信息
- 日常小结篇-日期处理(java程序,Oracle数据库)
- 字符串算法——二维有序数组中查找目标值(Search a 2D Matrix)
- VMware虚拟机中如何配置静态IP
- 选择排序
- HDU 5924 Mr. Frog’s Problem
- Java基础笔记
- 分布式架构:spring mvc +mybatis + Dubbo+Zookeeper+Proxy+Restfu
- 在eclipse里面启动tomcat的时候出错:A child container failed during start
- leetCode 11
- GAN的理解与TF的实现
- Git 如何删除本地分支和远程分支
- 图算法:强连通分量
- 多目标优化介绍(小生境)