#B3785. Ceiling Division and Debug Stream Analysis

    ID: 11442 Type: Default 1000ms 256MiB

Ceiling Division and Debug Stream Analysis

Ceiling Division and Debug Stream Analysis

This problem consists of two independent tasks. The first task involves performing a ceiling division calculation while the second focuses on analyzing a string for a specific substring.

Task 1

You are given three integers \(a\), \(b\), and \(c\). It is guaranteed that \(b-c \neq 0\). Compute the value of \[ \left\lceil \frac{a}{b-c} \right\rceil \] where \(\left\lceil x \right\rceil\) denotes the smallest integer not less than \(x\).

Task 2

You are given a string. In many debugging scenarios (especially in competitive programming), the stream std::cerr is used for printing intermediate variables since its output is flushed immediately and does not affect the standard output. In this task, if the given string contains the substring std::cerr, you should consider the string "Not Good"; otherwise, it is considered "Very Good". When multiple strings are given, process each one accordingly.

Overall Problem Structure: The input begins with an integer mode which indicates which task to perform.

  • If mode = 1, the next line contains three integers \(a, b, c\). Your task is to output \(\left\lceil \frac{a}{b-c} \right\rceil\).
  • If mode = 2, the next line contains an integer \(T\) (the number of test cases), followed by \(T\) lines, each containing a string. For each string, output Not Good if it contains the substring std::cerr; otherwise, output Very Good. Each output should be printed on a new line.

inputFormat

The input begins with an integer mode (1 or 2):

  • If mode = 1:
    • The next line contains three space-separated integers \(a\), \(b\), and \(c\) (with \(b-c \neq 0\)).
  • If mode = 2:
    • The next line contains an integer \(T\) indicating the number of test cases.
    • Each of the following \(T\) lines contains a non-empty string.

outputFormat

If mode = 1, output a single integer which is the result of \(\left\lceil \frac{a}{b-c} \right\rceil\).

If mode = 2, output \(T\) lines where each line is either Not Good (if the corresponding string contains std::cerr) or Very Good (otherwise).

sample

1
7 3 1
4