PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#CCBCHBAHAI0000106. Suy ra số phần tử bằng sizeof (Infer the Number of Elements with sizeof)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Suy ra số phần tử bằng sizeof (Infer the Number of Elements with sizeof)
Infer the Number of Elements with sizeof
Source: Understanding and Using C Pointers
Version: Phuoc Hung OJ Extended
Problem Statement
While is still an array object in the same scope, its element count can be computed as
$$\frac{\operatorname{sizeof}(a)}{\operatorname{sizeof}(a[0])}.$$Suppose sizeof(a) is bytes and sizeof(a[0]) is bytes. It is guaranteed that is divisible by . Compute the number of elements.
Input
One line contains two positive integers and : the size in bytes of the whole array and of one element.
Output
Print the integer .
Subtasks
Subtask 1 (20 points): , .
Subtask 2 (30 points): , .
Subtask 3 (50 points): , , and divides .
Examples
Input
80 8
Output
10
Explanation
Here and , so
The quotient is the number of array elements.