fragment-header
fragment-markdown
홈
로그인
로그아웃
내 블로그
설정
로그인
Codeforces Round 1049-B (Div. 2) Another Divisibility Problem
최초 업로드: 2025-09-09 16:54:14
최근 수정 시간: 2025-09-09 16:54:14
게시자: rlatjwls3333
카테고리: Codeforces
조회수: 29
# B. Another Divisibility Problem [문제 링크](https://codeforces.com/contest/2140/problem/B) ## Problem Statement Alice and Bob are playing a game in which Alice has given Bob a positive integer $x < 10^8$. To win the game, Bob has to find another positive integer $y < 10^9$ such that x # y is divisible by $x + y$. Here x \# y denotes the integer formed by **concatenating** the integers $x$ and $y$ in that order. For example, if $x = 835, y = 47$, then x # y = $83\,547$. However, since Bob is dumb, he is unable to find such an integer. Please help him. It can be shown that such an integer always exists. ## Input Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \leq t \leq 10^4$). The description of the test cases follows. The only line of each test case contains a single integer $x$ ($1 \leq x < 10^8$) — the integer that Alice has given to Bob. ## Output For each test case, print a single integer $y$ ($1 \leq y < 10^9$) so that Bob can win the game. If there are multiple answers, print any one of them. ## 풀이 x에다 2x를 이어붙인 값은 3x로 나누어 떨어진다. ``` c++ #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--) { ll x; cin >> x; cout << x*2 << '\n'; } } ```