Submission #1248693

#TimeUsernameProblemLanguageResultExecution timeMemory
1248693hayyyTrol (COCI19_trol)C++20
0 / 50
1 ms328 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; ll balik(ll K, ll F) { while (K > 0) { F += K % 10; K /= 10; } if (F > 9) return balik(F, 0); else return F; } int main() { ll N; cin >> N; ll A; ll B; for (ll i = 1; i <= N; i++) { ll ans = 0; cin >> A >> B; int X = balik(A, 0); int coba = B % 9; int apalah = (B - A)/9; // int bagi = apalah/45; // ans += bagi*45; for (ll i = 0; i <= coba; i++) { cout << ans << " "; if (X > 9) X = 1; ans += X; X += 1; } ans += apalah*45; cout << ans << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...