Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Odd number without loop in python

for tc in range(int(input())):
    a,b = map(int,input().split())
    x =  b//2 + (b%2)
    y =  a//2
    print("Case %d: %d"%(tc+1,x*x-y*y))
    
"""
Input:
2
1 10
2 10
Output:
Case 1: 25
Case 2: 24
"""
Comment

PREVIOUS NEXT
Code Example
Python :: decoding 
Python :: count substring in string python 
Python :: python scatter size 
Python :: how to get spotify playlist id in spotipy 
Python :: k means clustering python medium 
Python :: how to flatten list of lists in python 
Python :: fastest sorting algorithm java 
Python :: prettify json in pycharm 
Python :: how to generate two random numbers in python 
Python :: example exponential distribution python 
Python :: how to create Varible in python 
Python :: pytorch get tensor dimension 
Python :: code optimization in python 
Python :: pandas qcut 
Python :: string to list of characters python 
Python :: how to find the shortest word in a list python 
Python :: appdata/local/microsoft/windowsapps/python: permission denied 
Python :: discord.py 8ball 
Python :: python split large xml file by tag 
Python :: lowering the time.countdown python 
Python :: whole loop in python 
Python :: elavon converge api python tutorial 
Python :: python openstreetmap multiple latitude 
Python :: notebook python static website generator 
Shell :: ubuntu audio restart 
Shell :: conda statsmodels python 
Shell :: installing zoom on ubuntu 20.04 
Shell :: how to kill a process on a port? 
Shell :: centos stop apache 
Shell :: install material ui 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =