結果

問題 No.1842 Decimal Point
ユーザー ygd.
提出日時 2022-02-18 21:33:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 182 ms / 2,000 ms
コード長 750 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 82,408 KB
実行使用メモリ 76,676 KB
最終ジャッジ日時 2024-06-29 08:23:38
合計ジャッジ時間 1,407 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline #文字列につけてはダメ
input = sys.stdin.buffer.readline #文字列につけてはダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]


def main():
    t = int(input())
    for _ in range(t):
        a,b,c = map(int,input().split())
        g = math.gcd(a,b)
        a //= g; b //= g
        ans = a * pow(10,c,b*10) //b
        print(ans%10)     
        

if __name__ == '__main__':
    main()
0