結果
| 問題 | No.3152 neither multiple of A nor B | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-05-20 21:47:53 | 
| 言語 | PyPy2 (7.3.15) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 267 bytes | 
| コンパイル時間 | 1,435 ms | 
| コンパイル使用メモリ | 77,116 KB | 
| 実行使用メモリ | 76,116 KB | 
| 最終ジャッジ日時 | 2025-05-20 21:47:59 | 
| 合計ジャッジ時間 | 5,685 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | RE * 3 | 
| other | RE * 40 | 
ソースコード
import sys
import math
input = lambda: sys.stdin.readline().rstrip()
def solve():
    n, a, b = map(int, input().split())  
    lcm = (a*b)//math.gcd(a, b)
    ans = n - (n//a + n//b) + n//lcm
    print(ans)
t = 1
# t = int(input())
for _ in range(t):
    solve()
            
            
            
        