Categories
BLOG

lucky sum

Lucky sum

Петя любит счастливые числа. Всем известно, что счастливыми являются положительные целые числа, в десятичной записи которых содержатся только счастливые цифры 4 и 7 . Например, числа 47 , 744 , 4 являются счастливыми, а 5 , 17 , 467 — не являются.

Пусть next(x) — минимальное счастливое число, большее или равное x . Пете интересно, чему равно next(l) + next(l + 1) + . + next(r – 1) + next(r) . Помогите ему справиться с этой задачей.

В единственной строке задано два целых числа l и r ( 1 ≤ lr ≤ 10 9 ) — левая и правая граница промежутка.

В единственной строке выведите одно число — сумму next(l) + next(l + 1) + . + next(r – 1) + next(r) .

Пожалуйста, не используйте спецификатор %lld для чтения или записи 64-х битовых чисел на С++. Рекомендуется использовать потоки cin , cout или спецификатор %I64d .

Codeforces. Соревнования и олимпиады по информатике и программированию, сообщество программистов

Cash 3

HOW TO PLAY CASH 3

Pick Your Numbers

Choose three numbers 0–9 in each Play Area. You can play a single set of numbers (A) or up to five sets (A–E). Number selections can be separate (4-8-5) or duplicated (2-2-0) in a single play.

You can also simply mark the Quick Pick (QP) box on your playslip to let the computer choose for you.

Select Your Play Type

Each play costs $0.50 or $1.00, depending on which order you choose your numbers to be drawn.

For a $0.50 play, you can choose:

  • Exact Order – Must match winning numbers in order drawn.
  • Any Order – Must match winning numbers drawn in any order.

For a $1.00 play, you can choose:

  • Exact Order – Must match winning numbers in order drawn.
  • Any Order – Must match winning numbers drawn in any order.
  • Exact or Any Order – Combines a $0.50 “Exact Order” play and a $0.50 “Any Order” play for a 3-digit number on a single play. This play may only be played for $1.00.
  • Combo – Covers all possible EXACT 3-digit number combinations drawn in any order. This play may only be played for $1.00 and is equal to three or six Straight Plays for a total of $3.00 or $6.00.

Note: If no play type is specified, it will default to an Exact Order play.

Click to view larger

Play Multiple Draws

There are three drawings per day – Morning, Midday and Evening, except Sunday, which has an Evening drawing only. Pick the drawing(s) you would like to play. Select NEXT 2 or NEXT 3 to play your numbers for the next two or next three consecutive drawings following the time of purchase. Selecting NEXT 2 or NEXT 3 will double or triple the cost for each Play Area (A–E) you complete.

Note: If you choose to play NEXT 2 or NEXT 3, you cannot play the DAYS feature.

Play Multiple Days

If you would like to play your Morning, Midday or Evening numbers for more than one draw day, select one of the boxes marked 2–7 on your playslip under “DAYS.”

Note: If you chose NEXT 2 or NEXT 3 for the DRAWS feature, you cannot play the DAYS feature.

Add LUCKY SUM

For an additional $0.50 or $1.00 per play (matches cost of the base play), add LUCKY SUM to your playslip for the chance to win more cash! See below for details on how you could increase your winnings by adding this feature.

Buy Your Ticket

Check your playslip carefully to make sure you have correctly marked each selection before presenting it to a Tennessee Lottery retailer.

See a Mistake?

If you make an error, mark the “VOID” box at the bottom of the incorrect Play Area. DO NOT ERASE. You can also cancel your CASH 3 ticket on the terminal where it was produced within 15 minutes of purchase time or within the time remaining before the next scheduled draw break, whichever occurs first, or request the retailer to cancel the ticket and print one with your corrected selection(s).

Check Your Winnings

There are many ways to find out if your ticket is a winner. The quickest and easiest way is to scan your ticket or check the winning numbers using the TN Lottery App.

Cash 3 HOW TO PLAY CASH 3 Pick Your Numbers Choose three numbers 0–9 in each Play Area. You can play a single set of numbers (A) or up to five sets (A–E). Number selections can be ]]>