PROBLEM 20
Easy

Assistant — Integer Quotient of Two Numbers After Shift

Go Programming Basics · Go

</>
STATUS Not solved

TASK

Problem

#20

Two integers `a` and `b` are entered. First add 9 to `a` and 1 to `b`, then compute the integer quotient of the first resulting value divided by the second and print the result.

EXAMPLE

Example

Input
17 5
Output
4

LIMITS

Constraints

- Unless the statement says otherwise, integer inputs have absolute value at most 1,000,000.
- Every divisor used in the task is non-zero.
- Floating-point test values are chosen so the required arithmetic fits `float64`.
📖
LEARN Theory for this problem
+

`fmt.Scan`/`fmt.Fscan` parses whitespace-separated input into typed variables. The variable type controls how later arithmetic and comparisons behave.

Apply these rules directly to the task requirement: two integers `a` and `b` are entered. First add 9 to `a` and 1 to `b`, then compute the integer quotient of the first resulting value divided by the second and print the result.

💡
NEED HELP? Hints
+

['Read values in exactly the order stated by the condition.', 'Check the solution on a minimal, typical, and boundary input.', 'Use the sample input `17 5` to verify parsing and confirm that the program prints exactly `4` with no extra text.']

ANSWER Solution
+
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	left := a + 9
	right := b + 1
	result := left / right
	fmt.Println(result)
}