UVa12611 - Beautiful Flag

简介: UVa12611 - Beautiful Flag
#include <cstdio>#include <iostream>usingnamespacestd;
voidsolve(int);
intmain()
{
#ifndef ONLINE_JUDGEfreopen("e:\\uva_in.txt", "r", stdin);
#endifintt;
cin>>t;
for (inti=1; i<=t; i++) {
cout<<"Case "<<i<<":"<<endl;
intr;
cin>>r;
solve(r);
    }
return0;
}
voidsolve(intr)
{
doublelength=r*5;
doublewidth=length*3/5;
cout.precision(0);
cout<<fixed<<-length*9/20<<" "<<fixed<<width/2<<endl;
cout<<fixed<<length*11/20<<" "<<fixed<<width/2<<endl;
cout<<fixed<<length*11/20<<" "<<fixed<<-width/2<<endl;
cout<<fixed<<-length*9/20<<" "<<fixed<<-width/2<<endl;
}
目录
相关文章
|
3月前
bs4 beautifulsoup学习笔记
bs4 beautifulsoup学习笔记
16 0
UVa 374 Big Mod
UVa 374 Big Mod
38 0
UVa343 What Base Is This
UVa343 What Base Is This
43 0
|
XML 前端开发 数据格式
bs4之Beautiful Soup
bs4之Beautiful Soup
179 0
bs4之Beautiful Soup
|
索引
Beautiful Matrix
Beautiful Matrix
68 0
Beautiful Matrix
|
Java C语言
HDOJ(HDU) 2139 Calculate the formula(水题,又一个用JavaAC不了的题目)
HDOJ(HDU) 2139 Calculate the formula(水题,又一个用JavaAC不了的题目)
94 0
|
人工智能
poj2356:Find a multiple
题目链接: 【鸽巢原理+乱搞】 其实用不着开$map$ 一步最巧妙的转化是$……$前缀和。 反正本宝宝突发奇想就出来了。 首先,我们分类讨论。 1.当$∃i \in N_{+} $ 且 $i \in [1,n]$ 使 $a_{i} | n$ 则直接选这个数就好 2.没有以上那种特殊情况的话,我们记录前缀和$sum_{i}= \sum _{k=1}^{i} a_{k} (mod \ \ n)$ 然后又有两种情况。
1171 0