<jupyter_start><jupyter_text>A strange grid has been recovered from an old book. It has 5 columns and infinite number of rows. The bottom row is considered as the first row. First few rows of the grid are like this:............................20 22 24 26 2811 13 15 17 1910 12 14 16 18 1  3  5  7  9 0  2  4  6  8The grid grows upwards forever!Your task is to find the integer in 'c' column in 'r' row of the grid.<jupyter_code>import os
import sys


def strangeGrid(r, c):

    if (r%2 != 0):
        first_term=10*(r-1-(r//2))
        return(first_term + (c-1)*2)
    else:
        first_term = 1+((r//2)-1)*10
        return (first_term + (c-1)*2)
    

if __name__ == '__main__':
    fptr = open(os.environ['OUTPUT_PATH'], 'w')

    rc = input().split()

    r = int(rc[0])

    c = int(rc[1])

    result = strangeGrid(r, c)

    fptr.write(str(result) + '\n')

    fptr.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15443592552026286, 'fraction_numerical': 0.06352683461117196, 'mean_word_length': 2.4885496183206106, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '522266', 'license': 'MIT', 'n_tokens_mistral': 364, 'n_tokens_neox': 319, 'n_words': 114, 'path': 'Mathematics/1. fundamentals/12. strange grid again.ipynb', 'repo_name': 'faisalsanto007/Hakcerrank-problem-solving', 'size': '913'}