98152024-03-07 10:29:31EsVagyGergő és a sárkánycpp17Accepted 100/1003ms4380 KiB
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <climits>
#include <queue>
#include <fstream>
#include <sstream>
#include <math.h>
#include <list>

using namespace std;
using ll = long long;


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n, d;
    cin >> n >> d;
    n--;
    long long fnum = 1;
    long long rem = 0;
    for (size_t i = 0; i < n; i++)
    {
        fnum *= 10;
    }
    long long magnitude = fnum;
    rem = fnum % d;
    rem = d - rem;
    fnum += rem;
    long long secnum = fnum + d;
    if (secnum >= 10 * magnitude) {
        cout << "0 0";
        return 0;
    }
    else cout << fnum << " " << secnum;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1760 KiB
2Accepted3ms2200 KiB
subtask28/8
3Accepted3ms2412 KiB
4Accepted3ms2680 KiB
5Accepted3ms2592 KiB
6Accepted3ms2808 KiB
subtask316/16
7Accepted3ms3044 KiB
8Accepted3ms3256 KiB
9Accepted3ms3336 KiB
10Accepted3ms3572 KiB
11Accepted3ms3460 KiB
subtask47/7
12Accepted3ms3660 KiB
13Accepted3ms3888 KiB
14Accepted3ms3884 KiB
subtask511/11
15Accepted3ms3992 KiB
16Accepted3ms4236 KiB
17Accepted3ms4124 KiB
18Accepted3ms4220 KiB
subtask658/58
19Accepted3ms4336 KiB
20Accepted3ms4260 KiB
21Accepted3ms4160 KiB
22Accepted3ms4192 KiB
23Accepted3ms4268 KiB
24Accepted3ms4380 KiB
25Accepted3ms4272 KiB
26Accepted3ms4376 KiB