import math


def inWhichGrid(coord, grid_info):
    """
    Specify which grid it is in for a given coordinate
    :param coord: (latitude, longitude)
    :param grid_info: grid_info dictionary
    :return: row, column, grid ID
    """
    lat, lng = coord
    row = math.floor((grid_info['maxLat'] - lat) / grid_info['gridLat'])
    col = math.floor((lng - grid_info['minLng']) / grid_info['gridLng'])
    gridID = row * grid_info['lngGridNum'] + col
    return row, col, gridID