問題一覧 > 通常問題

No.260 The World's Something-or-Other 3

レベル : / AI推定難易度 : 1300 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 64 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 140
作問者 : kroton
お気に入りにしたユーザー ProblemId : 612 / 自分の提出
問題文最終更新日: 2026-06-25 00:55:14
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder 1周年記念 復習コンテスト R2 (順位表) の他の問題:

Problem Statement

A certain comedian is said to become "Aho" (foolish) on "multiples of 3 or numbers containing the digit 3", and to experience "Seishun" (youth) on "multiples of 8".
Among the integers between $A$ and $B$ inclusive, find how many numbers make him become "Aho" and do not make him experience "Seishun", modulo $10^9+7$.

Input

$A$ $B$

All inputs are given as integers.

  • \(1 \leq A \leq 10^{10000}\)
  • \(A \leq B \leq 10^{10000}\)

Output

Output the number of integers between $A$ and $B$ inclusive that make him become "Aho" and do not make him experience "Seishun", modulo $10^9+7$.

Sample

Sample 1
Input
1 100
Output
40

Sample 2
Input
114 514
Output
211

Sample 3
Input
1234 567890
Output
339733

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。