您的位置: 首页 > 文章 > Codeforces ~ 1088A ~ Ehab and another construction problem (暴力) Codeforces ~ 1088A ~ Ehab and another construction problem (暴力) 分类: 文章 • 2024-03-23 18:40:22 题意 给你一个x,让你求得一组a和b,满足a∗b>x,a/b<x,a%b=0a*b>x,a/b<x,a\%b=0a∗b>x,a/b<x,a%b=0,输出一组合法的a和b,如果没有输出-1. 思路 n2n^2n2暴力,或者O(1)。输出n-n%2和2. #include<bits/stdc++.h> using namespace std; int main() { int x; scanf("%d", &x); if (x == 1) printf("-1\n"); else printf("%d %d\n", x - x % 2, 2); return 0; } /* 10 */