Problem description

Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead.

A snake is a pattern on a n by m table. Denote c-th cell of r-th row as (r, c). The tail of the snake is located at (1, 1), then it's body extends to (1, m), then goes down 2 rows to (3, m), then goes left to (3, 1) and so on.

Your task is to draw this snake for Fox Ciel: the empty cells should be represented as dot characters ('.') and the snake cells should be filled with number signs ('#').

Consider sample tests in order to understand the snake pattern.

Input

The only line contains two integers: n and m (3 ≤ n, m ≤ 50).

n is an odd number.

Output

Output n lines. Each line should contain a string consisting of m characters. Do not output spaces.

Examples

Input

3 3

Output

###
..#
###

Input

3 4

Output

####
...#
####

Input

5 3

Output

###
..#
###
#..
###

Input

9 9

Output

#########
........#
#########
#........
#########
........#
#########
#........
#########
解题思路:按规律输出,当i为奇数时,输出的一行全部为'#';当i为偶数时,用flag做开关,交换输出两种格式,水过!
AC代码:
 #include<bits/stdc++.h>
using namespace std;
#define FOR(a,b,c) for(int i=a;i<=b;++i)printf("%c",c)
int n,m;bool flag;
int main(){
cin>>n>>m;flag=false;
for(int i=;i<=n;++i){
if(i%)FOR(,m,'#');
else{
if(!flag){FOR(,m-,'.');cout<<'#';flag=true;}
else{cout<<'#';FOR(,m,'.');flag=false;}
}
cout<<endl;
}
return ;
}

A - Fox And Snake的更多相关文章

  1. Codeforces Round #290 (Div. 2) A. Fox And Snake 水题

    A. Fox And Snake 题目连接: http://codeforces.com/contest/510/problem/A Description Fox Ciel starts to le ...

  2. Codeforces 510 A.Fox and Snake

    题目链接:http://codeforces.com/contest/510/problem/A A. Fox And Snake time limit per test2 seconds memor ...

  3. 找规律 Codeforces Round #290 (Div. 2) A. Fox And Snake

    题目传送门 /* 水题 找规律输出 */ #include <cstdio> #include <iostream> #include <cstring> #inc ...

  4. 【codeforces 510A】Fox And Snake

    [题目链接]:http://codeforces.com/contest/510/problem/A [题意] 让你画一条蛇.. [题解] 煞笔提 [Number Of WA] 0 [完整代码] #i ...

  5. CodeForces Round #290 Div.2

    A. Fox And Snake 代码可能有点挫,但能够快速A掉就够了. #include <cstdio> int main() { //freopen("in.txt&quo ...

  6. [LeetCode] Design Snake Game 设计贪吃蛇游戏

    Design a Snake game that is played on a device with screen size = width x height. Play the game onli ...

  7. Leetcode: Design Snake Game

    Design a Snake game that is played on a device with screen size = width x height. Play the game onli ...

  8. [DFNews] Fire-Eye与Fox IT联合推出Cryptolocker解锁网站

    Cryptolocker是臭名昭著的勒索程序,使用AES加密后密钥回传,用户除了缴纳赎金之外基本无法解密数据. 近日,知名安全公司Fire-Eye与Fox IT联合推出了针对该勒索程序的解锁网站 ht ...

  9. 在线教学、视频会议 Webus Fox(1)文本、语音、视频聊天及电子白板基本用法

    Webus Fox是基于网页的在线教学.视频会议软件,不用安装,直接使用.它提供文本.语音.视频聊天,文件共享.电子白板等功能. 1. 登录 访问 http://flash.webus.cn/#,用自 ...

随机推荐

  1. API开发管理平台eoLinker AMS 4.1版本发布:加入聚合空间,发布AMS专业版等

    eoLinker AMS是集API文档管理.API自动化测试.开发协作三位一体的综合API开发管理平台,是中国最大的在线API管理平台. eoLinker AMS 4.1更新内容: 1.新增" ...

  2. jquery制作动态添加表单行与删除表单行

    <script type="text/javascript" src="js/jquery1.7.js"></script> <s ...

  3. golang实现高阶函数之map

    package main import "fmt" func iMap(num []int, f func(a int) int) []int{ var r []int for _ ...

  4. JavaScript学习笔记之DOM介绍

    目录 1.简介 2.方法 3.属性 4.访问节点 5.修改节点 6.添加节点 7.删除节点 8.替换节点 9.改变 CSS 1.简介 文档对象模型(Document Object Model,DOM) ...

  5. 我理解的数据结构(一)—— 数组(Array)

    我理解的数据结构(一)-- 数组(Array) 首先,我是一个phper,但是毕竟php是一个脚本语言,如果使用脚本语言去理解数据结构具有一定的局限性.因为脚本语言是不需要编译的,如果你的语法写的不错 ...

  6. bytes类型和python中编码的转换方法

    一.bytes类型 bytes类型是指一堆字节的集合,在python中以b开头的字符串都是bytes类型.例如: >>> a = "中国" >>> ...

  7. [数据结构]C#顺序表的实现

    在数据结构的学习当中,想必C++可能是大家接触最多的入门语言了 但是C#的数据结构却很少看到,今天我写了一个C#顺序表的顺序存储结构 顺序表是在计算机内存中以数组的形式保存的线性表,线性表的顺序存储是 ...

  8. Dajngo——10 请求与响应 文件上传 GET和POST请求 类视图

    Dajngo——10 HttpRequest对象 HttpResponse对象及子类 form标签中的GET和POST GET提交方式 POST提交方式 request得GET和POST属性 文件上传 ...

  9. N天学习一个linux命令之vmstat

    用途 查看系统资源整体使用情况,包括进程数量,CPU,内存,IO,swap等资源统计信息 用法 vmstat [options] [delay [ count]] 常用选项 -a 显示active/i ...

  10. servlet 中getLastModified()

    在http协议中,浏览器对访问过的页面缓存后,它将会在以后访问该页面时,将会根据LastModified头字段指定的时间值生成If-Modified-Since头字段,作为缓存页面的最新更新时间.如果 ...