LIGHTOJ-1116 - Ekka Dokka

CANopen PDO 配置實戰:3步完成0x1800-0x1A00物件字典映射與事件觸發 本文详细解析CANopen PDO配置实战,通过3个关键步骤完成0x1800-0x1A00对象字典映射与事件触发设置。重点介绍COB-ID位域解析、映射参数配置及事件触发优化,帮助工程师实现工业自动化设备间毫秒级实时数据交换,提升系统通信效率。 阅读详情

1116 - Ekka Dokka
Time Limit: 2 second(s)Memory Limit: 32 MB

Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka is very fond of even numbers, they want to divide the cake such that Ekka gets a share of N square centimeters and Dokka gets a share of M square centimeters where N is odd and M is even. Both N and M are positive integers.

They want to divide the cake such that N * M = W, where W is the dashing factor set by them. Now you know their dashing factor, you have to find whether they can buy the desired cake or not.

Input

Input starts with an integer T (≤ 10000), denoting the number of test cases.

Each case contains an integer W (2 ≤ W < 263). And W will not be a power of 2.

Output

For each case, print the case number first. After that print "Impossible" if they can't buy their desired cake. If they can buy such a cake, you have to print N and M. If there are multiple solutions, then print the result whereM is as small as possible.

Sample Input

Output for Sample Input

3

10

5

12

Case 1: 5 2

Case 2: Impossible

Case 3: 3 4

 


让一个数分成一奇数,一偶数的乘积!


#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
	long long a,b,i,j,m,x,y,sum,cot=1;
	scanf("%lld",&m);
	while(m--)
	{
		scanf("%lld",&a);
		if(a&1)
		{
			printf("Case %lld: Impossible\n",cot++);
			continue;
		}
		b=a;
		sum=1;
		while(b%2==0)
		{
			b/=2;
			if(a%(long long)pow(2,sum)==0)
			{
				x=a/(long long)pow(2,sum);
				y=(long long)pow(2,sum);
			}
			sum++;
		}
		printf("Case %lld: %lld %lld\n",cot++,x,y);
	}
	return 0;
}



11、体内皮质功能的电压敏感染料成像技术 本文详细介绍了电压敏感染料成像(VSDI)技术在体内皮质功能研究中的应用。内容涵盖VSDI的技术起源、作用机制、信号特点与解读局限性,以及其在映射感觉皮质功能区方面的优势。文章对比了VSDI与电极记录和钙成像技术的差异,突出了其在高时空分辨率下监测神经元群体亚阈值活动的独特价值。同时,提供了完整的实验操作流程,包括手术步骤、染料应用、光学系统配置及数据分析方法,并总结了常见问题及其解决方案。随着基因靶向和多模态技术结合的发展,VSDI有望进一步提升信号特异性和空间精度,成为解析大脑网络动态的重要工具。 阅读详情

相关推荐

shopee app算法分析第一篇

shopee app算法分析第一篇分析完整算法大概要好几篇,耐心等待下.国内只会发律师函,牛逼,一个律师套话,一个律师发函,大意了(警惕卡通律师头像),希望law可以保护好你,还是干国外好.

2531

light oj1116 - Ekka Dokka 【简单数学】

1116 - Ekka Dokka PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Ekka and his friend Dokka decided to buy a cake. They bo

平平淡淡才是真 504

Win11系统下Abaqus 2025子程序开发环境一站式配置指南

本文详细介绍了在Win11系统下配置Abaqus 2025子程序开发环境的完整流程,包括VS2022和Intel oneAPI的安装与优化,以及Abaqus 2025的目录规划与环境联调。通过避坑指南和实战案例,帮助用户高效完成开发环境配置,避免常见错误,提升工作效率。

weixin_28717431的博客 332

LightOJ - 1116 (唯一分解定理)

题意:给一个w,然后分为n*m形式,n为奇数,m为偶数,问你是否有解,如果有解,输出的答案m尽可能小。 如果w是奇数肯定无解,因为偶数*奇数只能得到偶数。 当w为偶数时,根据唯一分解定理,它的偶数质因子只有2,我们只要找到2的个数,然后全给m,剩下的全给n即可。 #include #include #include using namespace std; typedef

阿狸的博客 259

STM32F407+HAL库+W5500实现TCP通讯 个人项目总结

推荐阅读此博客 cv即可成功首先需要一个可以进行串口调试的工程,方便进行调试。1.在W5500官网移植库文件重点是Ethernet这个文件夹将里面的 socket.c,socket.h,wizchip_conf.c,wizchip_conf.h,还有根据W5500文件夹里的w5500.c和w5500.h移植到自己的工程里面。然后再创建一个.c和.h文件 我的叫w5500_port_hal.c 和w5500_port_hal.h 记得将.h文件链接到工程里。

a234abr的博客 2247

YOLOv8_obb的C++工程部署实战:从模型转换到实时视频推理

本文详细介绍了YOLOv8_obb模型在C++环境下的完整工程部署流程,涵盖从PyTorch模型到ONNX格式的转换、基于ONNX Runtime的C++推理引擎搭建、旋转框后处理解析,以及实时视频流处理与性能优化。文章重点解析了模型转换的关键参数、环境配置的常见问题、核心推理代码的实现,并提供了实用的避坑指南,旨在帮助开发者高效完成YOLOv8_obb的C++工程部署。

weixin_29100927的博客 44

Ekka Dokka LightOJ 1116简单数学

Ekka and his friend Dokka decided to buy a cake. They both love cakes and that’s why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka ...

鸿杰 的博客 363

嵌入式开发必备:手把手教你用DB-9连接器搞定RS-232串口通信(附万用表测试技巧)

本文详细解析了嵌入式开发中RS-232串口通信的硬件连接核心。从DB-9连接器的引脚定义入手,深入讲解DTE与DCE设备角色,明确直连线与交叉线的选择法则,并重点分享了使用万用表进行线缆连通性测试、电压测量及故障诊断的实战技巧,帮助开发者彻底掌握串口通信的硬件连接与排查方法。

tgb345678的博客 1165

【LightOJ - 1116】Ekka Dokka 【算数基本定理】

Ekka and his friend Dokka decided to buy a cake. They both love cakes and that’s why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka i

lzs_lazy 411

3.6KW储能双向逆变器(原理图PCB源码)

通过百度网盘分享的文件:优快云 3.6KW储能双向逆变器 链接:https://pan.baidu.com/s/18NN6KnpywFUIDtAQ4b1LTg?pwd=csdn 提取码:csdn

2401_86562087的博客 2182

fast-lio系列改进版本

2.回环检测的优化结果,更新到FAST-LIO2的当前帧位姿中,幷进行ikdtree的重构,进而更新submap。其它的效果还不清楚,实测lio部分稳定性很好。用fast-lio_slam就很稳定。融合了fast-lio2和sc-pgo,两部分分开运行,SC-PGO从FAST-LIO2节点获取里程计和激光雷达点云主题。的作者kim在FAST-LIO2的基础上,添加SC-PGO模块,通过加入ScanContext全局描述子,进行回环修正,SC-PGO模块与FAST-LIO2解耦,非常方便,很优秀的工作。

z1872385的博客 3189

LightOJ - 1116 Ekka Dokka 思维

LightOJ - 1116 Ekka Dokka Ekka Dokka Time Limit: 2000MS   Memory Limit: 32768KB   64bit IO Format: %lld &amp; %llu Submit Status Description Ekka and his friend Dokka decided to buy ...

pxlsdz的博客 488

使用node-red网关读取modbus设备点表,并上传到市政低碳平台来统计数据

最近做了一个物联网项目,具体是这样的,利用node-red网关盒子,来采集Modbus设备的点表,然后将数据转换,封装,最终上传到市政的低碳平台。上一步封装了点表的数据,调用低碳平台还需要账号密码,建筑id,这些都是固定信息,所以我们单独提出来。上一步获取到了原始的点表数据,下一步就是将这些点表数据与在低碳平台创建的采集的对应起来,并且设置好分类。读取modbus的节点,会有两个输出,我是使用的第一个输出。msg.meters 是一个数组,里面的每一个元素都是一个点表,比如厨房用水,园区照明,

知无涯 947

lightoj1116 - Ekka Dokka【数学】

1116 - Ekka Dokka     PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Ekka and his friend Dokka decided to buy a cake. They both lov

走一步再走一步 600

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

LightOJ - 1116 Ekka Dokka

Ekka Dokka Time Limit: 2000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu Submit Status Description Ekka and his friend Dokka decided to buy a cake. T...

dixi7825的博客 163

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Ekka Dokka LightOJ - 1116( 暴力枚举)

Ekka and his friend Dokka decided to buy a cake. They both love cakes and that’s why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka ...

wait 206

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Ekka Dokka(LightOJ-1116)

Problem Description Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested that Ekka is very fond of ...

Alex_McAvoy的博客 449

LightOJ 1116 Ekka Dokka

Ekka Dokka Time Limit: 2000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu Submit Status Description Ekka and his friend Dokka decided to buy a cake. They both love c

A_ice 467

LightOJ 1116 - Ekka Dokka (简单数学)

1116 - Ekka Dokka PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Ekka and his friend Dokka decided

Chunzhen的博客 819

LightOJ 1116 Ekka Dokka (水题,简单数学)

Ekka Dokka Ekka and his friend Dokka decided to buy a cake. They both love cakes and that’s why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers...

Tan_JX 207

lightoj 1116 - Ekka Dokka 【分解因子】

1116 - Ekka Dokka PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Ekka and his friend Dokka decided to buy a cake. They both love c

世界很大 697

LightOJ - 1116 Ekka Dokka(数学)

题目链接:Ekka Dokka - LightOJ 1116 - Virtual Judge (vjudge.net) 题意:给你一个数x,让你找出满足等式n*m=x的解,其中n为偶数,m为奇数,要求n尽量小。 分析:由质因子分解定理我们可以知道,x可以唯一地由质数表示,又因为只有一个质数2是偶数,所以要想满足等式则必须要有x含有质因子2,其中求最小的偶数n就等价于求最大的奇数m,又因为奇数的质因子分解中不能含有2,所以只需要把x的质因子分解中除了2的质因子乘起来即可得到满足题目要求的m,n也就是x质因

AC__dream的博客 202

lightoj1116 - Ekka Dokka (数学)

Time Limit: 2 second(s)   Memory Limit: 32 MB Ekka and his friend Dokka decided to buy a cake. They bothlove cakes and that's why they want to share the cake after buying it. As thena

Pig_cfbsl的博客 455

LightOJ - 1116 Ekka Dokka

Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka...

hpu风之旅 147

E - Ekka Dokka LightOJ - 1116

Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka

gtuif的博客 328

LightOJ 1116 - Ekka Dokka【简单数学】

Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka is very fond of even numbers, they want to divide the ca

小I的博客 408
上一篇: LIGHTOJ-1078 - Integer Divisibility
下一篇: LIGHTOJ-1214 - Large Division
Eric_keke
博客等级 码龄12年 37粉丝 221原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值