mercredi 29 novembre 2017

How to store a variable from each time a loop is completed

Mr. Ya Rajaie has N books and wants to put them in bookshelves, each bookshelf can have at most 5 books. Find the minimum number of bookshelves needed to store the N books.

Input The first line of input contains a single integer T, the number of test cases.

Each test case contains a single integer N (1 ≤ N ≤ 10^9), the number of Ya’s books.

Output For each test case, print on a single line the minimum number of bookshelves needed to store the books.

In this problem I need to store a variable each time a loop is completed but I don't know how. her's the input and output examples Input: 2 7 15 output: 2 3

Aucun commentaire:

Enregistrer un commentaire