Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <string>
- #include <queue>
- #include <map>
- #include <set>
- #include <string>
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define nl endl
- #define cy cout << "YES\n"
- #define cn cout << "NO\n"
- #define sz s.size()
- void sherry()
- {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- /*
- ll gcd(ll a, ll b)
- {
- while (b)
- {
- a %= b;
- swap(a, b);
- c++;
- }
- return a;
- }
- ll lcm(ll a, ll b)
- {
- return a * b / gcd(a, b);
- }*/
- bool is_prime(ll x)
- {
- if (x == 2 || x == 3)
- return true;
- if (x == 1 || x % 2 == 0)
- return false;
- for (ll i = 3; i <= sqrt(x); i += 2)
- {
- if (x % i == 0)
- return false;
- }
- return true;
- }
- int main()
- {
- sherry();
- // freopen("sort.in", "r", stdin);
- ll t;
- cin >> t;
- while (t--)
- {
- ll n, m;
- cin >> n >> m;
- bool flag = true;
- for (ll i = n; i < 100; i += n)
- {
- for (int j = n; j < 100; j += n)
- {
- if ((i + j) % m == 0)
- {
- cout << i << " " << j << " " << i + j << nl;
- flag = false;
- break;
- }
- }
- if (!flag)
- {
- break;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement