Submission #482867

#TimeUsernameProblemLanguageResultExecution timeMemory
482867rainboyEuklid (COCI20_euklid)C11
4 / 110
1 ms204 KiB
#include <stdio.h> int main() { int t; scanf("%d", &t); while (t--) { int a, b; long long l, r; scanf("%d%d", &a, &b); l = b, r = b + b - 1; while (1) { long long x = r / a * a; if (x >= l) { printf("%lld %lld\n", x, x * b + a); break; } l *= b, r = (r + 1) * b - 1; } } return 0; }

Compilation message (stderr)

euklid.c: In function 'main':
euklid.c:6:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d", &t);
      |  ^~~~~~~~~~~~~~~
euklid.c:11:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d%d", &a, &b);
      |   ^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...