Daily Sugar Intake

0.5s 256M

AA Competitive Programming opened a bubble tea shop. Suppose you drink only this shop's bubble tea every day, and every cup you buy is completely finished.

For health reasons, you do not want to consume more than \(y\) grams of sugar in one day. Each cup of bubble tea contains exactly \(x\) grams of sugar. What is the maximum number of cups you can buy in one day without exceeding the sugar limit?

Syntax Restrictions

In short, solve this problem using only integer variable declarations, assignment operations, cin, cout, and arithmetic with +, -, *, /, and %. Expand the list below only if you want the full details.

This is a basic practice problem for standard input/output and integer arithmetic. To keep the focus on reading input, printing output, and deriving the answer with +, -, *, /, and %, submissions may use only the most basic C++ syntax. Your source code is checked automatically during judging; a submission that breaks the restrictions is judged SR (Syntax Restriction), and the judge feedback lists where the violation is.

Click to expand: allowed and forbidden syntax

Allowed:

  • #include <iostream> (the only allowed include)
  • using namespace std;
  • the int main() function and return 0;
  • declaring integer variables (e.g. int, long long)
  • reading with cin >> and printing with cout << (>> may only follow cin, << may only follow cout; you may print integers, variables, arithmetic results, and string or character literals, such as cout << "Hello" << '\n';, cout << "Hello\n";, and cout << answer << '\n';)
  • arithmetic operators: +, -, *, /, %
  • assignment operators: =, +=, -=, *=, /=, %=
  • comments (// and /* */)

Forbidden (common examples):

If some items below are completely unfamiliar, that is expected: they are not required at this practice stage and are not needed for this problem. You do not need to learn them now; just do not use them here.

  • conditionals and loops: if, else, for, while, do, switch, ?:
  • comparison and logical operators: <, >, <=, >=, ==, !=, &&, ||, !
  • ++, --
  • arrays [], and types/containers such as bool, float, double, string
  • calling or defining any function other than main (e.g. max, abs, pow, sqrt, getline)
  • any header other than <iostream>, and preprocessor directives such as #define

Input

The input consists of one line containing two positive integers \(x\) and \(y\). Here, \(x\) is the sugar content of one cup, and \(y\) is the daily sugar limit.

Constraints

  • \(1 \le x, y \le 10^9\)

Output

Output one integer: the maximum number of cups you can buy in one day.

Sample Input 1

3 8

Sample Output 1

2

Sample Input 2

3 9

Sample Output 2

3

Sample Input 3

5 2

Sample Output 3

0

Sample Input 4

1 1000000000

Sample Output 4

1000000000

Problem page help

Keyboard shortcuts

Main features

  • Sample tests — Runs the sample cases bundled with the problem and auto-compares against the expected output.
  • Custom test — Run your code with your own stdin. Optionally tick the "Compare with expected (diff)" box to verify against expected output line-by-line.
  • Template — Paste the default code template you set on your profile page.
  • Collab — Edit this problem together with classmates in real time.
  • Auto-draft — Editor contents auto-save to your browser every 1.5 seconds (per account / problem / language).
  • Submit — Send your code to the judge for grading; returns AC / WA / TLE etc.

Limits

  • Source code: at most 65,536 characters
  • Custom test stdin and expected output: at most 1 MB each (≈1 million characters)
  • Custom test: about 1 request per 3 s per user (sample test: 1 per 1 s)
  • Custom test has a 15 second wall-clock cap; sample tests use the problem time limit, the same as the official judge
  • Interactive problems do not offer custom test (cannot simulate interaction with the judge).
  • Submitting has no rate limit, but rapid repeated submissions on the same problem are treated as score farming.