time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Mishka got a six-faced dice. It has integer numbers from 22 to 77 written on its faces (all numbers on faces are different, so this is an almostusual dice).

Mishka wants to get exactly xx points by rolling his dice. The number of points is just a sum of numbers written at the topmost face of the dice for all the rolls Mishka makes.

Mishka doesn't really care about the number of rolls, so he just wants to know any number of rolls he can make to be able to get exactly xxpoints for them. Mishka is very lucky, so if the probability to get xx points with chosen number of rolls is non-zero, he will be able to roll the dice in such a way. Your task is to print this number. It is guaranteed that at least one answer exists.

Mishka is also very curious about different number of points to score so you have to answer tt independent queries.

Input

The first line of the input contains one integer tt (1≤t≤1001≤t≤100) — the number of queries.

Each of the next tt lines contains one integer each. The ii-th line contains one integer xixi (2≤xi≤1002≤xi≤100) — the number of points Mishka wants to get.

Output

Print tt lines. In the ii-th line print the answer to the ii-th query (i.e. any number of rolls Mishka can make to be able to get exactly xixi points for them). It is guaranteed that at least one answer exists.

Example

input

Copy

4
2
13
37
100

output

Copy

1
3
8
27

Note

In the first query Mishka can roll a dice once and get 22 points.

In the second query Mishka can roll a dice 33 times and get points 55, 55 and 33 (for example).

In the third query Mishka can roll a dice 88 times and get 55 points 77 times and 22 points with the remaining roll.

In the fourth query Mishka can roll a dice 2727 times and get 22 points 1111 times, 33 points 66 times and 66 points 1010 times.

每次都是两道,唉,何时才能提高啊

题解:把每次都看成2即可,感觉有点水

代码:

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring> using namespace std; int main()
{ int n;
cin>>n;
int k;
for(int t=0;t<n;t++)
{
cin>>k;
cout<<k/2<<endl;
} return 0;
}

Codeforces Round 56-A. Dice Rolling(思维题)的更多相关文章

  1. Codeforces Round #416 (Div. 2)(A,思维题,暴力,B,思维题,暴力)

    A. Vladik and Courtesy time limit per test:2 seconds memory limit per test:256 megabytes input:stand ...

  2. Codeforces Round #609 (Div. 2)前五题题解

    Codeforces Round #609 (Div. 2)前五题题解 补题补题…… C题写挂了好几个次,最后一题看了好久题解才懂……我太迟钝了…… 然后因为longlong调了半个小时…… A.Eq ...

  3. Educational Codeforces Round 56 (Rated for Div. 2)

    涨rating啦.. 不过话说为什么有这么多数据结构题啊,难道是中国人出的? A - Dice Rolling 傻逼题,可以用一个三加一堆二或者用一堆二,那就直接.. #include<cstd ...

  4. Educational Codeforces Round 56 (Rated for Div. 2) ABCD

    题目链接:https://codeforces.com/contest/1093 A. Dice Rolling 题意: 有一个号数为2-7的骰子,现在有一个人他想扔到几就能扔到几,现在问需要扔多少次 ...

  5. Educational Codeforces Round 56 Solution

    A. Dice Rolling 签到. #include <bits/stdc++.h> using namespace std; int t, n; int main() { scanf ...

  6. Educational Codeforces Round 40 C. Matrix Walk( 思维)

    Educational Codeforces Round 40 (Rated for Div. 2) C. Matrix Walk time limit per test 1 second memor ...

  7. Educational Codeforces Round 56 (Rated for Div. 2) F - Vasya and Array dp好题

    F - Vasya and Array dp[ i ][ j ] 表示用了前 i 个数字并且最后一个数字是 j 的方案数. dp[ i ][ j ] = sumdp [i - 1 ][ j ], 这样 ...

  8. Educational Codeforces Round 7 B. The Time 水题

    B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...

  9. Educational Codeforces Round 7 A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...

随机推荐

  1. 理解YOLOv2训练过程中输出参数含义

    原英文地址: https://timebutt.github.io/static/understanding-yolov2-training-output/ 最近有人问起在YOLOv2训练过程中输出在 ...

  2. hyperledger fabric学习(1)

    第一部分 环境搭建 说明 本次环境搭建是是现在虚拟机中,采用ubuntu 16.04版本,安装多次成功. 首先安装一些常用的工具 sudo apt-get update sudo apt-get in ...

  3. python之django入门

    一.搭建开发环境 使用virualenv创建虚拟python环境 pip install virtualenv [root@master djiango]# find / -name virtuale ...

  4. HTML5设计原理

    HTML5是Web标准的巨大飞跃,它为什么要包含那些东西,它背后的设计原则是什么? <JavaScript DOM编程艺术>和<HTML5 For Web Designer>作 ...

  5. bzoj 3073 [Pa2011]Journeys ——线段树优化连边

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3073 建两棵线段树,一棵孩子向父亲连边,是走出去的:一棵父亲向孩子连边,是走进来的. 注意第 ...

  6. cocos2d-x CCHttpRequest获取网络图片并显示

    转自:http://www.cnblogs.com/hzj730/p/3178431.html //图片结构 class imgstruct : public CCObject { public: i ...

  7. JS编写简易计算器

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/html"> <head lang=" ...

  8. JavaScript高级程序设计学习笔记第八章--BOM

    1.间歇调用和超时调用: 超时调用:需要使用 window 对象的 setTimeout()方法,它接受两个参数:要执行的代码和以毫秒表示的时间(即在执行代码前需要等待多少毫秒).其中,第一个参数可以 ...

  9. Spring入门第十七课

    AOP编程 问题: 代码混乱: 越来越多的非业务需求(日志和验证等)加入后,原有的业务方法急剧膨胀,每个方法在处理核心逻辑的同事还必须兼顾其他多个关注点. 代码分散:以日志需求为例,只是为了满足这个单 ...

  10. laravel ajax提交登陆存储session,并输出

    前端输出session {{ Session::get('username') }} ajax提交 <div>{{ Session::get('username') }}</div& ...