ACM刷題之codeforces————Ya Rajaie and Books

Ya Rajaie and Books
time limit per test
0.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

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 ≤ 109), 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.

Example
input
2
7
15
output
2
3


#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<string>
#include<iostream>
using namespace std;
#define MID(x,y) ((x+y)>>1)
#define CLR(arr,val) memset(arr,val,sizeof(arr))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int N=2e5+7;

int main()
{
	//freopen("f:/input.txt", "r", stdin);
	int zu,i,j,k;
	scanf("%d",&zu);
	while(zu--)
	{
		scanf("%d",&k);
		if(k%5!=0)
		printf("%d\n",k/5+1);
		else
		printf("%d\n",k/5);
	} 
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章